Taking in consideration a table tbl_users, I want to get a list of all users start from a certain letter and all the subsequent letters. For example, if I choose the letter 'C' it will display all users starting with 'C' and all the successive letters (i.e. 'D', 'E', etc.). How is it done?
Just use this WHERE clause:
WHER username >= 'C'
I did not test this, but I would think something like this:
SELECT *
FROM tbl_users
WHERE SUBSTRING(tbl_users.UserName, 0, 1) >= 'C'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With