Advertisement
rlfprog

Query to find all conversations

Jan 14th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.28 KB | None | 0 0
  1. SELECT cu.id,
  2.        cu.conversation_id,
  3.        cu.user_id, au.username
  4. FROM conversation_user cu
  5. INNER JOIN auth_user au
  6. ON cu.user_id = au.id
  7. WHERE conversation_id IN
  8.     (SELECT conversation_id
  9.      FROM conversation_user
  10.      WHERE user_id = 32)
  11.   AND user_id != 32;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement