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 / alka

select id,name, groupname from #temp1
Order by groupname,name

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is nonclustered index on computed columns?

566


What are the advantages of paper records?

545


Explain the different types of joins?

558


what is unique and xaml nonclustered index

550


What is meant by referential integrity?

581






What is the concept of optimization?

557


Explain differentiate between a having clause and a where clause?

505


How do I find the port number for sql server?

495


What types of replication are supported in sql server?

554


how to do partition in sqlserver

1962


Explain timestamp datatype?

544


Explain what is the main purpose of having conversation group?

514


How many types of built in functions are there in sql server 2012?

480


What is database white box testing?

663


What are the advantages of stored procedure in sql server?

454