How to get this value?

Welcome!
Prompt please how to dialog_id having a list of user IDs involved in the dialogue?
Gives Google GROUP BY... HAVING COUNT, but apparently that's not what I need.
5c9a585943df8922582796.png
March 19th 20 at 08:43
2 answers
March 19th 20 at 08:45
Solution
If this table is M:N, then
SELECT dialog_id FROM table_name WHERE user_id = 101 AND dialog_id IN
(SELECT dialog_id FROM table_name WHERE user_id = 103);

will give all dialog_id dialogues in which these two user consist.
thank you very much! - Bethany10 commented on March 19th 20 at 08:48
March 19th 20 at 08:47
SELECT DISTINCT dialog_id FROM baza WHERE users_ids IN (101, 103)
If user with user_id = 101 engages in dialogue with dialog_id = 2, and the user with user_id = 103 involved in the dialogue with the dialog_id = 3, this query will give:
dialog_id
2
3
And shall issue a void. - chance_Crooks12 commented on March 19th 20 at 08:50

Find more questions by tags MySQL