MySQL Forums :: Newbie :: ORDER BY TWO COLUMNS

Advanced Search

Posted by: Dur-E-Wahab Khan ()
Date: August 27, 2009 09:30PM

Hi how are all of you. I want to sort my table by two cols. Here is my table

1 3
2 1
3 1
4 2
5 1
6 4
7 7
8 3
9 2

I want to sort this so that it list associated records of second col under each record of first col. i-e, it should display 1 from the first col and then all 1s from second col. Next, display 2 in first col and then all 2s from second col... etc

I tried by using ORDER BY col1, col2 but it is not working.

Any help or suggestion will be really really appreciated.


Options: ReplyQuote

Subject Written By Posted
ORDER BY TWO COLUMNS Dur-E-Wahab Khan 08/27/2009 09:30PM
Re: ORDER BY TWO COLUMNS laptop alias 08/28/2009 03:31AM
Re: ORDER BY TWO COLUMNS Tom Melly 08/28/2009 04:43AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.