JOIN between tables with some (s) of them empty

Asked

Viewed 516 times

0

Goodnight I have 6 tables (A,B,C,D,E,F)

A tabela  A sempre contém registros  e tem uma chave primaria ID

The other tables B,C,D,E and F are all daughters of table A and have a column FK_ID that references the primary key of table A, but any of these tables may not contain any record, I wonder how I can make the joing among all tables that even with one of them not containing any record return all the data of the other. Is there any way to return without using FULL JOIN ?

1 answer

1

In tables that must be displayed even if there is no line corresponding to the clause ON, you replace the JOIN or INNER JOIN for LEFT JOIN.

INNER JOIN or JOIN means that the row will only be shown if it exists in the two or more tables being compared.

LEFT JOIN returns the rows of the table if it exists, if it does not exist it brings it in the same way. But with all the columns referring to this table with the value NULL.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.