I have a request:
SELECT * FROM `users` WHERE (`firstname` LIKE 'Luke' AND `lastname` LIKE 'Skywalker') OR (`firstname` LIKE 'Foo' AND `lastname` LIKE 'Bar') OR (`firstname` LIKE 'Tom' AND `lastname` LIKE 'Turner');
But I would like to make it more readable by using ... I tried
SELECT * FROM users WHERE `firstname` IN ('Luke','Foo','Tom') AND `lastname` IN ('Skywalker','Bar','Turner');
But, unfortunately, this will also match "Tom Skywalker" , "Foo Turner" and all the mixes you can come up with.
I need to select the first and last name (possibly more fields, such as DOB), since I get data from an external API, and I need to check if these names are on our system.
Werring
source share