Two "Order by" in the same code?

Results 1 to 2 of 2

Thread: Two "Order by" in the same code?

  1. #1
    Join Date
    Dec 1969

    Default Two "Order by" in the same code?

    How should I do I want to use "Order by"?<BR>I want to have a code that orders everything first by user and then by date...<BR>(I can&#039;t have a different code for each user, since I&#039;ll get new users all the time)<BR>This is how I it to look<BR><BR>user1<BR>post1<BR>post2<BR>post3<BR><B R>user2<BR>post1<BR>post2<BR><BR>user3<BR>post1<BR >post2<BR>post3<BR>post4<BR><BR>Something like that...

  2. #2
    Join Date
    Dec 1969

    Default Order by columnName1, columnName2

    You can have as many columns (or expressions rather) in your order by clause as you like. Just put a comma between them. Each expression can also be qualified with ASC or DESC to get the right sort order.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts