Link to home
Start Free TrialLog in
Avatar of apresto
aprestoFlag for Italy

asked on

Using LIKE in an IN clause - SQL

Hi guys/Gals

Is it possible to use a LIKE clause within an IN clause of an SQL statement, for example:

...WHERE somefield IN (Like '%LTD%', Like '%PLC%')

any idea's for using this in SQL server?

ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

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 apresto

ASKER

Thanks Scott

yeh, i tried 'like' but i wondered if it was possible to use a Like withing an IN, or is that a job for CASE?

Is there any other way to do what im trying to other than straight likes?
Not that I know of
Avatar of apresto

ASKER

ok cool, cheers

Im gonna leave the question open for abit incase someone else knows of a way (doubltful), but why not :o)

thanks again
SOLUTION
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
SOLUTION
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 apresto

ASKER

Thanks guys, I didnt think it was possible, but i just went with OR's in the end

Thanks for your contributions

Apresto
Glad to be of assistance.
Huji