November 17, 2009

MySQL REGEXP: where first letter is numeric

Category: mysql, Tags: , , khadlock at 11:58 am

Get MySQL results where the first letter is numeric:

SELECTFROM table WHERE (LEFT(columnname,1) REGEXP '[0-9]')

Or get MySQL results where the first letter is alpha:

SELECTFROM table WHERE (LEFT(columnname,1) REGEXP '[a-z]')
Bookmark and Share

Leave a Reply