Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ---------------------------
- | table_1 |
- ---------------------------
- | id | t1_col | t2_col_id |
- ---------------------------
- ---------------
- | table_2 |
- ---------------
- | id | t2_col |
- ---------------
- */
- 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