I have a table with a column containing data that begin with numbers too, on MySQL
How can I select the rows that begin only with a number?
SELECT * FROM YourTable WHERE YourColumn regexp '^[0-9]+'
Yet another way:
WHERE LEFT(columnName,1) IN ('0','1','2','3','4','5','6','7','8','9')
and with common charsets and collations, this would work and use an index on the column:
WHERE columnName >= '0' AND columnName < ':'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With