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
Is there any difference between the primary key and unique key?
How do you know if sql server is running on your local system?
Who developed sql server?
What is difference between view and materialized view?
what purpose does the model database serve? : Sql server database administration
Explain the purpose of indexes?
How to get the definition of a user defined function back?
Which autogrowth database setting is good?
How do you rebuild an identity column?
What’s the distinction between dropping a info and taking a info offline?
How to create an index on a view?
Explain “not null constraint” in sql server?
how can u get last observation in an unknown dataset ?
What is logshipping and its purpose?
How to verify a user name with sqlcmd tool?