Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT m.from_user_id,
- m.message,
- m.send_date
- FROM message m
- WHERE m.conversation_id IN (
- SELECT cu.id,
- cu.conversation_id,
- cu.user_id,
- au.username
- FROM conversation_user cu
- INNER JOIN auth_user au ON cu.user_id = au.id WHERE conversation_id IN
- (SELECT conversation_id
- FROM conversation_user
- WHERE user_id = 32)
- AND user_id != 32
- )
- ORDER BY send_date DESC LIMIT 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement