SHARE
TWEET

Untitled

a guest Jun 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. +-----------+--------------+------+-----+---------+----------------+
  2. | Field     | Type         | Null | Key | Default | Extra          |
  3. +-----------+--------------+------+-----+---------+----------------+
  4. | msgID     | int(11)      | NO   | PRI | NULL    | auto_increment |
  5. | userID    | int(11)      | NO   |     | NULL    |                |
  6. | msgText   | varchar(255) | NO   |     | NULL    |                |
  7. | msgStatus | varchar(255) | NO   |     | NULL    |                |
  8. | userName  | varchar(255) | NO   |     | NULL    |                |
  9. +-----------+--------------+------+-----+---------+----------------+
  10.      
  11. +-------+--------+-------------------+-----------+----------+
  12. | msgID | userID | msgText           | msgStatus | userName |
  13. +-------+--------+-------------------+-----------+----------+
  14. |     1 |      1 | hi                | unread    | Francis  |
  15. |     2 |      2 | hello             | unread    | Emma     |
  16. |     3 |      1 | good              | unread    | Francis  |
  17. |     4 |      1 | your not easy     | read      | Francis  |
  18. |     5 |      2 | just no that      | unread    | Emma     |
  19. |     6 |      2 | don't lose it bro | unread    | Emma     |
  20. |     7 |      2 | good keep it up   | unread    | Emma     |
  21. |     8 |      3 | i don't hate it   | unread    | John     |
  22. +-------+--------+-------------------+-----------+----------+
  23.      
  24. +--------+----------+
  25. | userID | userName |
  26. +--------+----------+
  27. |      1 | Francis  |
  28. |      2 | Emma     |
  29. |      3 | John     |
  30. +--------+----------+
  31.      
  32. select userID, userName FROM msg GROUP BY userID;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top