Hello
this SQL statement
"select firstname,lastname from users where lastname in('foo','bar') group by firstname"
it means select all records in table "users" where lastname match any of the "foo" or "bar"
I don't want this behaviour
what I want to retrieve is all records in "users" table where lastnames match all of "foo" and "bar"
so is there anything to do that?
I knew I should replace in('foo','bar') with something but I don't know that thing!?
Thanks
update
for example if the table has these records
firstname | lastname
user1 foo
user1 bar
user2 foo
the SQL query should retrieve user1 but not user2 since user2 has 'foo' but does not have 'bar'