Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

i have a table #temp1(id, Name groupname ) and record
like this 1 R1 S
2 R3 S
3 R2 S
4 R4 D
5 R5 D
6 R6 K
7 R7 K
8 R8 L
9 R9 L
10 R10 L
11 R11 K

and i want to display record based on user defind sorting
order e.g.
1 R4 D
2 R5 D
3 R6 K
4 R7 K
5 R11 K
6 R1 S
7 R3 S
8 R2 S
9 R8 L
10 R9 L
11 R10 L

Answer Posted / veeresh kethari

SELECT ROW_NUMBER() OVER(ORDER BY GROUPNAME ASC) ID
,NAME,GROUPNAME FROM REC ORDER BY GROUPNAME

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are triggers? How do you invoke a trigger on demand?

1246


What is a database in ms sql server?

995


What is the difference between cube operator and rollup operator? : SQL Server Architecture

1058


What are the options which must be set to allow the usage of optimistic models?

917


What is the difference between a local and a global temporary table?

1056


Disadvantages of the indexes?

1050


What command do we use to rename a db, a table and a column?

876


What is the user of Primary key?

926


what are the types of indexes? : Sql server database administration

1062


What stored by the msdb? : sql server database administration

954


How you can minimize the deadlock situation?

983


Can you please explain the difference between primary keys and foreign keys?

1059


What is rolap and its advantage? : sql server analysis services, ssas

1220


what is isolation level at dead lock?

2089


What is mean by dml?

945