I'm trying to do a select in n tables and show a few columns of each, but sometimes I can't match some columns and instead of getting a line with "null" the entire line is omitted.
For example:
table_a
id | ... |
---|---|
1 | |
2 | |
3 |
table_b
id | name | ... |
---|---|---|
1 | a1 | ... |
2 | b2 | ... |
3 | c3 | ... |
table_c
name | ... |
---|---|
a1 | ... |
And then I do the following select:
select
a.id,
c.name
from
table_a a,
table_b b,
table_c
where
( 1 = 1 )
and a.id = b.id
and b.name = c.name
I'm geting:
id | name | ... |
---|---|---|
1 | a1 | ... |
I'm looking for:
id | name | ... |
---|---|---|
1 | a1 | ... |
2 | null | ... |
3 | null | ... |
How do I do that? I checked a few answers around including this one but I didn't get how to solve it.