Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Order by / Group by?

Status
Not open for further replies.

anitalulu

Programmer
Nov 19, 2002
23
HK
Hi,

I want to order by the sequence of each id to display.

My table structure is:

id Name seq
---------------------------------
1 abc@yahoo.com 3
1 Cheung 2
1 Anita 1
2 def@yahoo.com 3
2 Leung 2
2 Crystal 1


My expected ResultSet is:

id Name seq
---------------------------------
1 Anita 1
1 Cheung 2
1 abc@yahoo.com 3
2 Crystal 1
2 Leung 2
2 def@yahoo.com 3
.
.
.

Any one can help me?
 
Hi

Try this:

select id, name, seq
from (your tablename)
order by id, seq

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top