Look for all questions where two users have contributed with any of question, answer or comment
Q&A for pro webmasters
-- Where have we met before? -- Look for all questions where two users have contributed with any of question, answer or comment select coalesce(parentid,id) from posts where owneruserid=##UserA## --533832 or exists(select * from comments where postid=posts.id and userid=##UserA##) intersect select coalesce(parentid,id) from posts where owneruserid=##UserB## --15354 or exists(select * from comments where postid=posts.id and userid=##UserA##)