Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. /*
  2. ---------------------------
  3. | table_1 |
  4. ---------------------------
  5. | id | t1_col | t2_col_id |
  6. ---------------------------
  7.  
  8. ---------------
  9. | table_2 |
  10. ---------------
  11. | id | t2_col |
  12. ---------------
  13. */
  14.  
  15. SELECT *, (SELECT t2_col FROM table_2 WHERE id=t2_col_id) AS t2_col FROM table_1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement