select * from Customers WHERE Name AND Surname in ('Peter,Pan','Roger,Rabbit','Captain,Hook')

hi,
i've got a Customers Table with Fields Name,SurName
How can i write a query selecting multiple names and surnames e,g.
select * from Customers WHERE Name AND Surname in ('Peter,Pan','Roger,Rabbit','Captain,Hook')

thank you!
jxhardingAsked:
Who is Participating?
 
Aneesh RetnakaranDatabase AdministratorCommented:
select * from Customers WHERE REPLACE(Name + ',' + Surname,' ','') in ('Peter,Pan','Roger,Rabbit','Captain,Hoo<wbr/>k')
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
select * from Customers WHERE Name IN ('Peter,Pan','Roger,Rabbit','Captain,Hook') or  Surname in ('Peter,Pan','Roger,Rabbit','Captain,Hook')

0
 
mherchlCommented:
try this

select * from Customers WHERE Name + ',' + Surname in ('Peter,Pan','Roger,Rabbit','Captain,Hook')
0
 
LowfatspreadCommented:
generally

select * from Customers
 WHERE (Name = 'Peter' AND Surname ='Pan')
  or (Name = 'Roger' and Surname = 'Rabbit')
  or (Name = 'Captain' and surname = 'Hook')

should be more efficient
...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.