Reputation:
im trying to select * from table1 where forename, surname = 'Joe Bloggs'
obviously forename and surname are 2 different columns in table one but im getting errors when i run this SQL code:
SELECT * from table1 where forename, surname = 'Joe Bloggs'
Any ideas on what i can do?
Upvotes: 1
Views: 167
Reputation: 263693
maybe you mean
SELECT * from table1 where CONCAT_WS(' ',forename, surname) = 'Joe Bloggs'
OR
SELECT * from table1 where 'Joe Bloggs' IN (forename, surname)
OR
SELECT * from table1 where forename = 'Joe' AND surname = 'Bloggs'
Upvotes: 5