Forum Moderators: open

Message Too Old, No Replies

Query help

         

TheSeoGuy

7:20 pm on Jun 28, 2007 (gmt 0)

10+ Year Member



If I have a table that has the following data:

categoryID, sortOrder
1, 1
1, 2
1, 3
2, 4
2, 5
1, 6

What would my sql statement be if I wanted to gather all data grouped by category but in sort Order... for a resulting recordset of...

categoryID, sortOrder
1, 1
1, 2
1, 3
1, 6
2, 4
2, 5

Thanks

LifeinAsia

8:39 pm on Jun 28, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



SELECT categoryID, sortOrder
FROM YourTable
ORDER BY categoryID, sortOrder