I have a table as follows
id comm_id user_id ..
This stores user subscriptions to communities. Now I want to query this table so that only those subscriptions are fetched which are mutual between 2 users(say user_id: 2 and 9)
Give me the sql query
tablename: db_community_subscribers
id, community_id, user_id
"20" 1 "2"
"28", NULL "2"
"31" NULL, "2"
"43", 4 "2"
"47 1 9
"57", NULL, "2"
"59", "12", "9"
"60 14 2
"62", NULL 2
These are the subscriptions of users 2 and 9
I want to select only 1 and 12 since these are the common subscriptions
try this one:
I think this will work now:
OR