I have a base table and many query results
first is the base list:
a, b
name1, type1
name2, type2
name3, type3
name4, type4
b is an ID
others are SELECT result like this (count the types in the other table)
null, 5
type1, 3
type4, 3
null is 5 because in the other table many rows haven't any type
if I use LEFT JOIN
type1, 3
type4, 3
and not null row, because null not included in a base list
I did a trick:
SELECT a, b
FROM table1
UNION
SELECT "none", null
FROM table1
result:
name1, type1
name2, type2
...
name4, type4
none, null
BUT if I tried the LEFT JOIN, no change
name1, type1, 3
name2, type2, null
...
name4, type4, 3
none, null, null
how can I put the null, 5 value in the joined result? (ok I can use the RIGHT and LEFT OUTER JOIN, but I have many result tables, which I want to join the base list)
Thank you so much, and sorry for my poor english :)