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


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
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!