portabletelly Posted May 31, 2007 Share Posted May 31, 2007 Hi im trying to get a list of priorities in reverse order. Is there a command which is directly opposite to ORDER BY Currently I have several calls (rows) in the data table with priorities ranging from 1, 2, 3, 4 Calls with a priority of 1's are diplayed at the top of my page and 4 at the bottom. My problem is I need them in the opersite order can this be done in the select statement. I thought there might have been some kind of ORDER BY REVERSE statement or somthing. This is my query. $query_get_calls ="SELECT * FROM data WHERE TechID ='$techid' ORDER BY priority";[code] [/code] Quote Link to comment https://forums.phpfreaks.com/topic/53801-order-by/ Share on other sites More sharing options...
gabeg Posted June 1, 2007 Share Posted June 1, 2007 Lowest to Highest $query_get_calls ="SELECT * FROM data WHERE TechID ='$techid' ORDER BY priority ASC"; Highest to Lowest $query_get_calls ="SELECT * FROM data WHERE TechID ='$techid' ORDER BY priority DESC"; Quote Link to comment https://forums.phpfreaks.com/topic/53801-order-by/#findComment-265993 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.