johnsmith153 Posted January 24, 2011 Share Posted January 24, 2011 "ORDER BY field" would return 1, 2 3 in that order However I want it to return 3, 1, 2 (there are actually no other possible responses) How would I do this? Quote Link to comment Share on other sites More sharing options...
johnny86 Posted January 24, 2011 Share Posted January 24, 2011 ORDER BY field DESC Quote Link to comment Share on other sites More sharing options...
btherl Posted January 24, 2011 Share Posted January 24, 2011 There's a few ways to do that. ORDER by field = 3 DESC, field That should do it. Or ORDER BY CASE WHEN field = 3 THEN 0 ELSE field END Or you could order by "field mod 3", which will map 3 to 0 and leave 1 and 2 unchanged. Quote Link to comment Share on other sites More sharing options...
johnsmith153 Posted January 24, 2011 Author Share Posted January 24, 2011 Great, thanks btherl 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.