cry of war Posted November 7, 2007 Share Posted November 7, 2007 Say i have a table full of words and i want to select the words that have their first letter as an "A" then after that it sorts the items alphabetically how would i go about doing that I understand the query in all like SELECT * FROM 'blah' WHERE ???(goes in here some where) ORDER BY ??? Thanks in advance CoW Link to comment https://forums.phpfreaks.com/topic/76393-solved-order-by/ Share on other sites More sharing options...
GingerRobot Posted November 7, 2007 Share Posted November 7, 2007 Sorry? Im not sure what the problem is. By ordering your results by the field, you would get the the results beginning with an a first. The query, at is simplest, is just: SELECT * FROM `yourtable` ORDER BY `thefield` Link to comment https://forums.phpfreaks.com/topic/76393-solved-order-by/#findComment-386829 Share on other sites More sharing options...
cry of war Posted November 7, 2007 Author Share Posted November 7, 2007 SELECT * FROM `items` WHERE 'Prefix is equal to "A"' ORDER BY `thefield` for example "items" dog apple cat ant dish so the query would select apple && ant then it would put it in this order: ant apple Link to comment https://forums.phpfreaks.com/topic/76393-solved-order-by/#findComment-386833 Share on other sites More sharing options...
trq Posted November 7, 2007 Share Posted November 7, 2007 SELECT * FROM `items` WHERE `thefield` LIKE 'A%' ORDER BY `thefield` Link to comment https://forums.phpfreaks.com/topic/76393-solved-order-by/#findComment-386841 Share on other sites More sharing options...
cry of war Posted November 7, 2007 Author Share Posted November 7, 2007 thank you so much again thorpe your a life saver. Link to comment https://forums.phpfreaks.com/topic/76393-solved-order-by/#findComment-386843 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.