SQL Query Help! I am trying to select a line that does NOT start with a number

I have 10,001 rows in my table and all but one row start with a number. I need to find this one line that does not start with a number or even does not contain a number.

So this is what I have:

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

Is it even close? I need to find a string that does not have a number ...

Thank!!

UPDATE: I am using sqlite database

+3
source share
5 answers

Using:

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

Reference:

+5
source

On Sql Server

Select * From table
Where col1 Like '[^0-9]%'

EDIT: I don't know if equullent exists in SQLLIte,

but it will work ...

Select * From table
Where col1 Not Like '0%' 
   And col1 Not Like '1%'
     ...
   And col1 Not Like '9%'
+3
source

, Regex Ms SQL.

.

0

@Dueber , ?

SELECT * FROM table1 WHERE col1 > '9'

, , .

SELECT *
FROM   table1
WHERE  ISNUMERIC(SUBSTRING(col1,1,1)) = 0

SUBSTRING

ISNUMERIC

0

- , ; , .

select * from table1 where col1 not between '0' and '9:'; 

( ASCII "9", "9999999" ).

, (, ).

0

Source: https://habr.com/ru/post/1775095/


All Articles