B
B
brainflow2015-11-28 17:47:04
PostgreSQL
brainflow, 2015-11-28 17:47:04

How to compose SQL, is there a dialogue with such a composition of participants?

Terrible blunt, the work got up.
The task seems to be trivial, but the brain does not turn, the community's help is needed.
There is a table with a list of dialogue participants:
tbl_participants
id, user_id, dialog_id
At the input there is a list of user_id (it can contain two or more id)
It is necessary to determine from this list whether there is already a dialogue with exactly this composition of participants.
Those. no more, no less, namely with these users.
I know how to solve this problem with several queries, but something tells me there is a more elegant solution.
Saturday night - it's time to work!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
heartdevil, 2015-11-28
@brainflow

Hello. Look
here . Solve almost the same problem as yours.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question