Skip to content
Advertisement

Multiple full joins in one query on multiple tables

I have a database with multiple tables, I wish to show all contents from every table with one query (that I will use later for a research in the database).

view of the database

I’ve tried with two tables

but it returns an error.

I’m using 10.4.14-MariaDB version.

full join query error

Advertisement

Answer

One method uses multiple left joins, starting with all available ids:

This approach easily generalizes to more tables using the same key for the JOIN.

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