Skip to content
Advertisement

How to to JOIN 2 tables with foreign key pointing to other table primary key to return all the row that have such primary key in SQL?

Please help I need to get rows in the 2 tables with the foreign key poiting to table_a as seen on picture. I have tried Joining this way,

but it return empty results. Please help me to fix such SQL JOIN statement

PLEASE LOOK AT THE PHOTO I MADE WHICH SHOW THESE TABLES AND MORE ELABORATION

enter image description here

Advertisement

Answer

could be that you have not valid match in table_b and table_c (your id for table_a don’t match values in table_b and table_c)

try use left join

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement