Link to home
Create AccountLog in
Avatar of vb7guy
vb7guyFlag for United States of America

asked on

Select SQL Query Multiple phrases using "like" parameter

Can I combine two SQL phrase in a single where clause. Here is an example. it hasn't worked for me and I couldn't find any in the help file.  I may have more then two publicationID that I'm trying to pull, but I don't know the full name.

I want to able to use "like" and "in" in the same statement.

select PublicationID,publicationname  from dbo.tblPublication where publicationname in (like '%Asia Pac%',like '%Global Watch%')
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
select PublicationID,publicationname  from dbo.tblPublication where publicationname in (

SELECT publicationname  FROM  dbo.tblPublication where publicationname   like '%Asia Pac%',like '%Global Watch%')
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
oops dont care about mine, i accidently press the subit button :)
Avatar of vb7guy

ASKER

Aaah, Thanks.  "OR" is what I thought. But I wish if it was easy to just use "IN" statement and "LIke" phrase.   Thanks