Guest User

Untitled

a guest
Jan 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. num
  2. ---
  3. 2
  4. 2
  5. 2
  6. 2
  7. 3
  8. 3
  9.  
  10. id | users
  11. ------------
  12. 1 | Jhon
  13. 2 | Jimmy
  14. 3 | Michael
  15. 4 | Simon
  16. 5 | Tom
  17.  
  18. SELECT users
  19. FROM table_2 a
  20. INNER JOIN (SELECT DISTINCT num FROM table_1) b
  21. ON a.id = b.num;
  22.  
  23. SELECT users
  24. FROM table_2 a
  25. INNER JOIN (SELECT num FROM table_1 group by num) b
  26. ON a.id = b.num
Add Comment
Please, Sign In to add comment