Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL query help!! I'm trying to select the row that DOESN'T start with a number

I have 10,001 rows in my table, and all of the rows except one start with a number. I need to find this one row that doesn't start with a number, or even that doesn't contain a number.

So this is what I have:

Select col1 from table1 where col1 not like '?%'

Is this even close? I need to find the row that doesn't have a number...

Thanks!!

UPDATE: I am using a sqlite database

like image 547
Jerry Avatar asked Jan 22 '23 02:01

Jerry


1 Answers

Use:

SELECT col1
  FROM table1 
 WHERE SUBSTR(col1, 1, 1) NOT BETWEEN 0 AND 9

Reference:

  • core functions (incl SUBSTR)
  • LIKE
like image 160
OMG Ponies Avatar answered Jan 29 '23 10:01

OMG Ponies