July 29 2015

Mysql query to display name range from a to g

Tagged Under :

MySQL
I need to listing out name of the person start from lowercase a to g and uppercase A to G in MySQL. You can use MySQL regexp to get the results you want.

Example SQL:
SELECT * FROM USERS WHERE name REGEXP '^[A-G|a-g]'

The above query will listing out all the results where name start from a to g

Make a Comment

You must be logged in to post a comment.