Hello. How can I make a selection from the MySQL database of words that begin with a specific letter?

Considering that the letter can be both Russian and English.

PS that this extension is outdated - I know.

An example of a regular query with a selection of all records:

$sql = mysql_query("SELECT * FROM `table` ORDER BY `id` DESC"); 

    1 answer 1

     SELECT `word` FROM `table` WHERE `word` LIKE 'ы%'; 

    or

     SELECT `word` FROM `table` WHERE LEFT(`word`, 1) = 'ы'; 

    or

     SELECT `word` FROM `table` WHERE LOCATE(`word`, 'ы') = 1; 
    • thank. I will test - I will accept the answer. thank you for help. - iKey
    • 2
      The first option is the most correct. The rest will not be able to use the index (if available) - Anton Shchyrov
    • @ Denis Only with collation do not promaryazhsya ... - Akina
    • and why the 2 and 3 option, there is a letter and a number? - iKey
    • @Denis In the first version - just a check for pattern matching. In the second - the check that the first character (hence the number) is equal to the specified. In the third - check that the first time a given character is in the FIRST position. - Akina