[thelist] Knuckle-headed SQL Question

James Spahr james at designframe.com
Mon Nov 6 12:24:47 CST 2000


on 11/6/00 1:18 PM, Michele Foster at michele at wordpro.on.ca wrote:

> Here's my solution for ASP/Access database... I'd be interested to know if
> there is a better option .. this one works just fine for me tho, but am not
> sure how well it does performance wise.
> 
> SqlString = SqlString & "SELECT whatever FROM wherever "
> SqlString = SqlString & "WHERE (Name LIKE '0%') OR (Name LIKE '1%') OR (Name
> LIKE '2%') OR (Name LIKE '3%') OR (Name LIKE '4%') OR (Name LIKE '5%') OR
> (Name LIKE '6%') OR (Name LIKE '7%') OR (Name LIKE '8%') OR (Name LIKE '9%')
> "
> 
> Ron's solution is the same I use for letters Name Like 'A%'.

I'd try 

SELECT whatever FROM wherever WHERE Name RLIKE '[0-9].*'

RLIKE, or REGEXP let you use full regex for searches.

James.






More information about the thelist mailing list