Page 1 of 1

LIKE question

Posted: Wed Oct 24, 2007 11:36 am
by alex.barylski
I have a small problem, not really important but still:

I want to find only the names of records whose start with the digits 0-9 using a SQL expression like:

Code: Select all

SELECT * FROM table WHERE LIKE '[0-9]%'
This code works well for indexing a-z but I need it to work with 0-9 all at once. Does LIKE support regex style abbreviations like I have shown above, or will I have to resort to something like:

Code: Select all

SELECT * FROM table WHERE LIKE '0%'
Thanks :)

Posted: Wed Oct 24, 2007 12:01 pm
by feyd
If you're using MySQL there is the REGEXP statement....

Posted: Wed Oct 24, 2007 12:18 pm
by alex.barylski
Sweet. Worked like a charm. Thanks man. :)