Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select distinct id_tabela1,
- tid_tabela2, tid_tabela3, tid_tabela4
- from tabela1 t1
- left join tabela2 t2 on t1.id_tabela1 = t2.tid_tabela2
- left join tabela3 t3 on t1.id_tabela1 = t3.tid_tabela3
- left join tabela4 t4 on t1.id_tabela1 = t4.tid_tabela4
- where...
- id_tabela1 | tid_tabela2 | tid_tabela3 | tid_tabela4
- 1 | x | null | null
- 1 | z | null | null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement