[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 600
  • Last Modified:

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!
0
jxharding
Asked:
jxharding
  • 2
2 Solutions
 
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
 
Aneesh RetnakaranDatabase AdministratorCommented:
select * from Customers WHERE REPLACE(Name + ',' + Surname,' ','') in ('Peter,Pan','Roger,Rabbit','Captain,Hoo<wbr/>k')
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now