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
Explain the concept of view and Types of views in SQL server?
What are the properties of the transaction?
What are the types of indexes?
Why the trigger fires multiple times in single login?
What is always encrypted?
What is log cache in sql server?
How to scale out a federation by Sql statement?
What is the recursive stored procedure in sql server?
What is model database? : SQL Server Architecture
How to list all dsn entries on your local machine using odbc_data_source()?
what protocol both networks use? : Sql server database administration
How does stuff differ from the replace function?
What is BLOCK statements in SQL?
Do you know the cursor types?
Can we use trigger new in before insert?