how to select from database a text orgonized Alphabetically
Hi!
please how can i make a selecting from my database orgonased by order of Alphabet exemple on the top of my website i wanna put A B C E D .... every letter take all the names in the database wish start by the letter clicked please !
3 Answers
its very easy just use left():
\"select * from `films2` where left(title, 1) = \'%a\'\"This assumes that you haven\'t foolishly used a case sensitive collation as well. In case you were being silly and did that well: \"select * from `films2` where left(lower(title), 1) = \'%a\'\" Posted: MacOS 1 of 1 people found this answer helpful. Did you? Yes No
I believe you can use a LIKE statement to achieve this.
SELECT * FROM `table` WHERE `title` LIKE 'a%'That will select anything where the title starts with an 'a', the % allows for anything after that. I'm not sure if this is case-sensitive or not (I don't believe it is), can someone confirm either way? Posted: Go 2 of 2 people found this answer helpful. Did you? Yes No
i think you can order the films by title
just use select from `films2` order by title Posted: xtremex 1 of 1 people found this answer helpful. Did you? Yes No |
© Advanced Web Core. All rights reserved