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 different types of data sources?

1023


What is the difference between char and varchar2 datatype in sql?

1070


What is query and its types?

919


what are user defined datatypes? : Sql server database administration

971


Do you know what is rank function?

1081


How retrieve field names from the table in SQL through JAVA code?

1915


What is database replication? What are the different types of replication you can set up in sql server?

964


How to insert stored procedure result into temporary table?

1020


what are the important architecture components of SSRS?

140


Tell me what is normalization? Explain different forms of normalization?

1033


What are page splits?

1002


Can you type more than one query in the query editor screen at the same time?

1011


How to update a field in SQL after ALTERING a row?

1236


Which command is used for user defined error messages?

1067


How to enter binary string literals in ms sql server?

1167