Gossamer Forum
Home : General : Databases and SQL :

Please help ... SQL searching question

Quote Reply
Please help ... SQL searching question
I could really use some help ...

I am trying to conditionally select data from a table (ie select * from database where variable like/= etc) ...

is there a way to combine the like and in statements ...

I want to use a "where variable in (data1, data2, data3, etc.) and use wildcards for the entrys ... (ie like '%data1%')

Is this possible?? the alternative is to keep repeating the "where variable like '%data1%' or variable like '%data2%' or ... " I use a whole pile of these and this takes way too long :(

I would appreciate any help!!!
Quote Reply
Re: [jherring] Please help ... SQL searching question In reply to
How about?

WHERE Field1 LIKE '%value%' OR Field2 LIKE '%value%' OR Field3 LIKE '%value%'

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Please help ... SQL searching question In reply to
ahh .. misinterpretation ... I know that way .... what I want to do is be able to use wildcards in the

WHERE Field1 in ('value', 'value', 'value' etc....) statement

thanks for the quick response though!