Link to home
Start Free TrialLog in
Avatar of stepherd
stepherd

asked on

General SQL Query Question

How does one pass a LIKE query to all the fields in a database?  For example, the following:
     SELECT * from Genetics WHERE Genetics.author LIKE '%smith%'
Returns records with "smith" in the authors field, but what if I wanted to search for "smith" in ALL the fields?
I tried
     SELECT * from Genetics WHERE Genetics.* LIKE '%smith%'
And it didn't work (yes, I'm new to SQL).

Any help would be appreciated.

Thanks,

Dave Stephens

ASKER CERTIFIED SOLUTION
Avatar of tschill120198
tschill120198

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stepherd
stepherd

ASKER

Thanks for the input. Yeah, I thought this might be the case.  I am building the SQL dynamically using PERL, so it shouldn't be a problem to approach it as you suggest.
Never hurts to ask! Thanks.

--Dave Stephens