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

Is there any difference between the primary key and unique key?

1042


How do you know if sql server is running on your local system?

1095


Who developed sql server?

982


What is difference between view and materialized view?

987


what purpose does the model database serve? : Sql server database administration

1028


Explain the purpose of indexes?

1021


How to get the definition of a user defined function back?

1086


Which autogrowth database setting is good?

1096


How do you rebuild an identity column?

996


What’s the distinction between dropping a info and taking a info offline?

1090


How to create an index on a view?

1139


Explain “not null constraint” in sql server?

1090


how can u get last observation in an unknown dataset ?

2486


What is logshipping and its purpose?

1066


How to verify a user name with sqlcmd tool?

1119