Selecting records from a specific letter onwards

Taking the table into account tbl_users

, I want to get a list of all users starting with a specific letter and all subsequent letters. For example, if I select the letter "C", it displays all users starting with "C" and all subsequent letters (eg "D", "E", etc.). How it's done?

+3


source to share


3 answers


Just use this WHERE clause:



WHER username >= 'C'

      

+3


source


Have this as a condition.

SUBSTRING(UPPER(name),1,1) >= 'C'

      



Have not tried it. If that doesn't work please specify the table structure

+1


source


I haven't tested this, but I would think something like this:

SELECT *
FROM tbl_users
WHERE SUBSTRING(tbl_users.UserName, 0, 1) >= 'C'

      

+1


source







All Articles