I have one table with this data :
I would like to get the thread_id shared only by the user_id 140 and 1.
So in my example the result would be 356 and 358.
With this request
select a.user_id , b.user_id, a.thread_id
from `wp_bp_messages_recipients` as a, `wp_bp_messages_recipients` as b
where a.thread_id = b.thread_id
and a.user_id = 1
and b.user_id = 140
I have 356, 358, 359, but i don't want the thread_id 359 because it is shared with the user_id 5.
Thank's a lot for your help !