SHARE
TWEET

Untitled

a guest Jan 18th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
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