Darkmatter5 Posted October 17, 2008 Share Posted October 17, 2008 I have a database with a table called Clients. It has two specific fields, LastName and CompanyName. I know I can alphabetize by LastName in ascending order and then by CompanyName, but how could I alphabetize by LastName and CompanyName in ascending order at the same time. So company names and last names are all sorted together. Example. Anderson Belarc, Inc. Smith Farlow Zooteck & Co. Quote Link to comment https://forums.phpfreaks.com/topic/128780-how-to-alphabetize-by-multiple-fields/ Share on other sites More sharing options...
dropfaith Posted October 17, 2008 Share Posted October 17, 2008 ORDER BY category, name; Quote Link to comment https://forums.phpfreaks.com/topic/128780-how-to-alphabetize-by-multiple-fields/#findComment-667612 Share on other sites More sharing options...
akitchin Posted October 17, 2008 Share Posted October 17, 2008 since dropfaith's reply is probably of no help whatsoever, how do you want to handle the ordering in the case that both LastName and CompanyName are set? or is it always that only one of the two will be set? Quote Link to comment https://forums.phpfreaks.com/topic/128780-how-to-alphabetize-by-multiple-fields/#findComment-667641 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.