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

Explain the concept of view and Types of views in SQL server?

1038


What are the properties of the transaction?

1057


What are the types of indexes?

1136


Why the trigger fires multiple times in single login?

1284


What is always encrypted?

1061


What is log cache in sql server?

1103


How to scale out a federation by Sql statement?

118


What is the recursive stored procedure in sql server?

1081


What is model database? : SQL Server Architecture

1194


How to list all dsn entries on your local machine using odbc_data_source()?

1093


what protocol both networks use? : Sql server database administration

1021


How does stuff differ from the replace function?

1064


What is BLOCK statements in SQL?

1312


Do you know the cursor types?

1207


Can we use trigger new in before insert?

971