I am currently learning how to program in SQL. I have a table1 with firstname, lastname and roomname.
And I have another table2 that has all the roomnames.
I was wondering how to select firstname and lastname from those people who have been in ALL of the rooms. Do I need a GROUP BY?
For TransactSQL, if you know that every row in your first table is distinct, then this would work:
This should be pretty efficient, but not too flexible, in case you wanted to ignore certain rooms.