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
chris05
source
to share
3 answers
Just use this WHERE clause:
WHER username >= 'C'
+3
Lasse Vågsæther Karlsen
source
to share
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
Chetter hummin
source
to share
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
ericosg
source
to share