JOIN between tables with some of them empty

0

Good Night     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 an FK_ID column that references the primary key of table A, but any of these tables may contain no record, I would like to know how can I make joing between all tables that even with one of them containing no records return all the data of the others. Is there any way to return without using FULL JOIN?

    
asked by anonymous 14.07.2017 / 01:09

1 answer

1

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

INNER JOIN or JOIN means that the line 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 does the same. But with all the columns referring to this table with the value NULL .

    
14.07.2017 / 01:14