Query that returns multiple wildcard criteria using Like and In
821611Dec 6 2010 — edited Dec 7 2010Hi there, trying to do something like this:
Select * from tablename
Where columnname Like '5%' or Like '8%' or Like '12%'
without using OR...so basically this:
Selet * from tablename
Where columnname Like IN ('5%', '8%', '12%')
In MS Sql, i can do something like this:
SELECT * from tablename t
Where exists(Select val FROM dbo.fn_String_To_Table('25,05', ',', 0)
ata WHERE columname LIKE val + '%' )
Where dbo.fn_String_To_Table converts the string array to a table.
Any suggestions?
Thanks much.