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? Link to comment https://forums.phpfreaks.com/topic/246271-select-column1-from-mysql-where-column2-first-alphabetically/ 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" Link to comment https://forums.phpfreaks.com/topic/246271-select-column1-from-mysql-where-column2-first-alphabetically/#findComment-1264700 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 Link to comment https://forums.phpfreaks.com/topic/246271-select-column1-from-mysql-where-column2-first-alphabetically/#findComment-1264707 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.