aebstract Posted April 12, 2010 Share Posted April 12, 2010 I have 3 columns of numbers that go with a user. I want to display the list of users in order based on these numbers, but I want user 1 to be the person with the lowest number, throughout all 3 fields. So on and so on for the rest. I obviously know how to do it for one column ORDER BY column, but is there a built in function or simple way to order by the lowest of the three fields per individual? Thanks Quote Link to comment Share on other sites More sharing options...
JustLikeIcarus Posted April 12, 2010 Share Posted April 12, 2010 Try the least() function select * from tabe order by least(col1, col2, col3) Quote Link to comment Share on other sites More sharing options...
aebstract Posted April 12, 2010 Author Share Posted April 12, 2010 Sweet, I'll be giving it a try in the next hour or so. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.