faqts : Computers : Databases : Microsoft SQL Server

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 2 people (50%) answered Yes
Recently 1 of 2 people (50%) answered Yes

Entry

How to select all values that start with number [0..9] ?

Nov 11th, 2006 11:37
Matt Chatterley, Martin Martin,


Assuming that the data you are searching on is numeric in nature:
SELECT * FROM Table WHERE LEFT(CAST(NumData AS VARCHAR), 1) IN
('0','1','2','3','4','5','6','7','8','9')
If the data is character/string data, as above, but without using CAST!