MySQL Select Based on first letter
Posted: Tue Jun 17, 2003 7:25 am
I've got a database of users and want to create a members list. I've set it up so that a member can click on, say, "A" for all usernames beginning with an "A". However, I have quite a lot of members whose names begin with a digit or non-alphanumeric character. How do I form a select to grab all data where a username's first character is not alphanumeric?
My current query for selecting names starting with "A" reads something like this:
My current query for selecting names starting with "A" reads something like this:
Code: Select all
SELECT * FROM users WHERE username like "A%"