I have an elementary many-to-many relation in my Postgresql DB
Table - User
id name ...
Table - Chat
id name
Table - chatuser
id userId chatId
And I would like to get all chats (actually, there will be only one such chat), which will have only users, defined by their ids.
For example, I have user with id 1, user with id 2 and user with id 3. How can I get chats, which contain only these users, not less and not more. That means, that chats with only someone of these users will not be included in the result. Only chats which contain exactly these users
I understand, there`s got to be such question already, but I did not manage to find it.