deansatch Posted September 2, 2011 Share Posted September 2, 2011 Basically I am trying to do that literal statement: select column1 from mysql WHERE column2 = (first alphabetically) order by column1 asc There should be multiple results. i.e. column1 is car models, column2 is car manufacturers. So I want to get all models ONLY by the manufacturer that comes first alphabetically. Is there a way to do this before I resort to 2 separate queries? Quote Link to comment Share on other sites More sharing options...
deansatch Posted September 2, 2011 Author Share Posted September 2, 2011 Well.... writing that actually made me think more logically and I solved it myself within seconds!!! SELECT DISTINCT model FROM vans WHERE manufacturer = (SELECT manufacturer FROM vans ORDER BY manufacturer desc LIMIT 1) ORDER BY model asc" Quote Link to comment Share on other sites More sharing options...
deansatch Posted September 2, 2011 Author Share Posted September 2, 2011 oh..and that should be asc not desc 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.