Guest User

Untitled

a guest
Aug 22nd, 2018
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. id - message - sender - receiver
  2. 1 - hello - 1 - 2
  3. 2 - hello - 1 - 2
  4. 3 - hello - 2 - 1
  5. 4 - hello - 3 - 1
  6. 5 - hello - 1 - 3
  7. 6 - hello - 23 - 1
  8. 7 - hello - 1 - 23
  9. 8 - hello - 1 - 2
  10.  
  11. id - name - email - phone
  12. 1 - abc1 - abc@gmail.com - 1234567890
  13. 2 - abc2 - abc@gmail.com - 1234567890
  14. 3 - abc3 - abc@gmail.com - 1234567890
  15. 23 - abc23 - abc@gmail.com - 1234567890
  16.  
  17. SELECT * FROM messages INNER JOIN users ON messages.sender=users.id OR messages.receiver=users.id WHERE users.id!='1' GROUP BY users.id
Add Comment
Please, Sign In to add comment