How can I select rows only where first digit is a number from 0 to 9?

mysql, php

Solution

Try this

SELECT * 
FROM BadlyDesignedTable 
WHERE AnswerColumn RLIKE '^[0-9]+'

I was wondering if it was even possible to regex in where, found it on google in 30 seconds.

Problem

As far as I know I can do something like: ``` "SELECT * FROM my_table WHERE my_field LIKE '0%' OR my_field LIKE '1%' OR my_field LIKE '2%' "; ``` Is there a way to achieve this with a regular expression or something like this: ``` "SELECT * FROM my_table WHERE my_field LIKE [only first char is 0-9]"?? ``` EDIT: The field is not numeric and it can be something like "1 People", "211 Pies" and so on.

Original source