sqlite - SQL Select all rows starting with numbers from 0-9 -


i use sqlite select rows starting letter, eg:a, b, c.

select title dictionary title 'a%' order title asc select title dictionary title 'b%' order title asc select title dictionary title 'c%' order title asc ... 

but want select titles starting number 0-9, like '0-9%'.

first of can tidy original statements adding or:

select title dictionary title 'a%' or name '%b' or name '%c' order title asc. 

to answer problem can use regex title string based.

where title regexp '^[0-9]+'  

or

where (left(title, 1) in ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')) 

you can try substring , numeric function:

where isnumeric(substring(val, 1, 1))  

not tested think on how resolved


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -