Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. SELECT * FROM tableA
  2. LEFT JOIN tableB ON tableB.id = tableA.id
  3. WHERE tableA.name = 'myName'
  4.  
  5. tableA tableB
  6. ----------- -----------
  7. id name id school
  8. ----------- -----------
  9. 1 a 1 AA
  10. 2 b 2 BB
  11. 3 c 3 CC
  12. 4 d 4 DD
  13. 5 e 5 EE
  14.  
  15. SELECT * FROM
  16. (
  17. SELECT * FROM tableA
  18. WHERE name = 'e'
  19.  
  20. ) A LEFT JOIN tableB ON tableB.id = A.id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement