User UserID Name Adress bla... a Max b Peter c Ben Join_User_Room JoinID UserID RoomID d a x e a y f a z g b x h b y i b z Room RoomID Name x Room1 y Room2 z Room3
Left join and right joins and other crazy sql stuff
select * from User join Join_User_Room on UserID = UserID join Room on RoomID = RoomID where RoomID in( X, Y, Z)
select DISTINCT u.UserId, u.Name from [User] u join Join_User_Room jur on u.UserID = jur.UserID join Room r on jur.RoomID = r.RoomID where jur.RoomID in( 'X', 'Y', 'Z')
SELECT u.* FROM [User] u JOIN (SELECT ju.UserID FROM Join_User_Room ju GROUP BY ju.UserID) jg ON jg.UserID = u.UserID
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)