Jump to content

[SOLVED] order by two rows?


XpertWorlock

Recommended Posts

Is it possible two sorts by two rows in a database

 

I.e. Sort by one row (integer) and than another row (integer).

 

 

0/0, 0/1, 0/2, 0/3, 0/4, 1/0, 1/1, 1/2, 2/0, 2/1,

 

etc.

 

I've tried various methods and am trying to do it with as little code as possible

 

Thanks alot

Mike

 

Link to comment
Share on other sites

I think you might be asking about sorting by two columns? If so, you need an ORDER BY term in the query that lists the columns -

 

ORDER BY column1, column2

 

This will sort using column1 values, then within each value in column1, it will sort using the column2 values.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.