Jump to content

Query table, sort by lower number of the two located in different colums


pioneerx01
Go to solution Solved by iarp,

Recommended Posts

OK, the title is bit confusing. Lets say that I have a table with three columns (name, no1, no2) with following rows: (Mike, 5, 7), (Julie, 6, 2) and (Jack, 8, 3). Is there a query that will allow me to sort the results in such way that it will sort them by the lowest number from either no1 or no2, depending on which one is the lowest? So, the query would look at no1 and no2 and pick only the lowest one, do the same for rest of the rows and then order them by lowest resulting numbers? So the results should be:

 

(Julie, 6, 2)

(Jack, 8, 3)

(Mike, 5, 7)

 

Thanks

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.