select coalesce(a.n,0) as a, coalesce(b.n,0) as b, coalesce(c.n,0) as c, coalesce(a.s,b.s,c.s) as s from ( select 1 as n, 0 as s) a full outer join ( select 1 as n, 1 as s) b full outer join ( select 2 as n, 2 as s) c on a.s = b.s and b.s = c.s
.... and get a syntax error at the end of my query. Apparently what I'm trying to do doesn't make sense?
Maybe this is what you want...
select coalesce(a.n,0) as a, coalesce(b.n,0) as b, coalesce(c.n,0) as c, coalesce(a.s,b.s,c.s) as s from ( select 1 as n, 0 as s) a full outer join ( select 1 as n, 1 as s) b on a.s = b.s
full outer join ( select 2 as n, 2 as s) c on b.s = c.s
a | b | c | s ---+---+---+--- 1 | 0 | 0 | 0 0 | 1 | 0 | 1 0 | 0 | 2 | 2
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match