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 Quote Link to comment 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` Quote Link to comment 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 Quote Link to comment 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` Quote Link to comment 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. 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.