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 different types of data sources?
What is the difference between char and varchar2 datatype in sql?
What is query and its types?
what are user defined datatypes? : Sql server database administration
Do you know what is rank function?
How retrieve field names from the table in SQL through JAVA code?
What is database replication? What are the different types of replication you can set up in sql server?
How to insert stored procedure result into temporary table?
what are the important architecture components of SSRS?
Tell me what is normalization? Explain different forms of normalization?
What are page splits?
Can you type more than one query in the query editor screen at the same time?
How to update a field in SQL after ALTERING a row?
Which command is used for user defined error messages?
How to enter binary string literals in ms sql server?