phillbooth Posted July 14, 2009 Share Posted July 14, 2009 Hi, I need a querystring that will allow those entries with infomation in row Y to appear both last on my results and only row Y to appear at random. Something like: ORDER BY X ASC, Y DESC AND WHERE Y='123' ORDER BY RAND() Please help! Quote Link to comment https://forums.phpfreaks.com/topic/165918-order-by-appear-last-and-random/ Share on other sites More sharing options...
gassaz Posted July 14, 2009 Share Posted July 14, 2009 Maybe if you give to us more information, we can try to help you.. Quote Link to comment https://forums.phpfreaks.com/topic/165918-order-by-appear-last-and-random/#findComment-875447 Share on other sites More sharing options...
fenway Posted July 16, 2009 Share Posted July 16, 2009 You could use IF() to check for the Y condition in the order by clause. Quote Link to comment https://forums.phpfreaks.com/topic/165918-order-by-appear-last-and-random/#findComment-876353 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.