Find rows that have same value in one column and other values in another column?
I have a PostgreSQL database that stores users in a users table and conversations they take part in a conversation table. Since each user can take part in multiple conversations and each conversation can involve multiple users, I have a conversation_user linking table to track which users are participating in each conversation: # conversation_user id | conversation_id | user_id ----+------------------+-------- 1 | 1 | 32 2 | 1 | 3 3 | 2 | 32 4 | 2 | 3 5 | 2 | 4 In the above table, user 32 is having one conversation with just user 3 and another with both 3 and user 4. How would I write a query