Skip to content
Advertisement

Join 2 Tables and display everything

I have 2 simple tables:

table a:

table b:

I am trying to join 2 tables like this:

It works, but, if there is no entry in the “b” table it wont show anything.

what the sql shows is something like this:

I also want to list the “empty” row a.id=1:

Any ideas? Thanks! (SQL is for MS Access / oledb)

Advertisement

Answer

You want a left outer join (or a full outer join, if you want rows in which there is no entry in the a table also).

Depending the system, the syntax LEFT JOIN may work as well.

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