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
What are triggers? How do you invoke a trigger on demand?
What is a database in ms sql server?
What is the difference between cube operator and rollup operator? : SQL Server Architecture
What are the options which must be set to allow the usage of optimistic models?
What is the difference between a local and a global temporary table?
Disadvantages of the indexes?
What command do we use to rename a db, a table and a column?
What is the user of Primary key?
what are the types of indexes? : Sql server database administration
What stored by the msdb? : sql server database administration
How you can minimize the deadlock situation?
Can you please explain the difference between primary keys and foreign keys?
What is rolap and its advantage? : sql server analysis services, ssas
what is isolation level at dead lock?
What is mean by dml?