johnsmith153 Posted December 4, 2008 Share Posted December 4, 2008 How would I set two different values using "Order By" in SQL (ie so it sorts into order of a person's age, and then for duplicates it orders by their name) "Order By age,name" wont work either. Quote Link to comment https://forums.phpfreaks.com/topic/135561-easy-if-you-have-half-a-brain-sql-order-by-2-different-values/ Share on other sites More sharing options...
premiso Posted December 4, 2008 Share Posted December 4, 2008 ORDER BY age, name Should work, show us the query. Quote Link to comment https://forums.phpfreaks.com/topic/135561-easy-if-you-have-half-a-brain-sql-order-by-2-different-values/#findComment-706211 Share on other sites More sharing options...
Mchl Posted December 4, 2008 Share Posted December 4, 2008 It should. That's the correct syntax. Quote Link to comment https://forums.phpfreaks.com/topic/135561-easy-if-you-have-half-a-brain-sql-order-by-2-different-values/#findComment-706212 Share on other sites More sharing options...
PFMaBiSmAd Posted December 4, 2008 Share Posted December 4, 2008 Post an example of your data, your table definition, and the results you are getting. I'm going to guess that your age calculation is incorrect or it is not a numeric data type. Telling us something does not work is pointless, we know it is not or you would not be posting in a help forum, you need to show exactly what it is or is not doing. Quote Link to comment https://forums.phpfreaks.com/topic/135561-easy-if-you-have-half-a-brain-sql-order-by-2-different-values/#findComment-706234 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.