Re: [GENERAL] Apparently I don't understand full outer joins....

2005-01-26 Thread Lee Harr
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

Re: [GENERAL] Apparently I don't understand full outer joins....

2005-01-25 Thread Ben
Thanks guys, this works great. On Tue, 25 Jan 2005, Stephan Szabo wrote: > > Each outer join gets an on clause. You might want something like: > 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 >

Re: [GENERAL] Apparently I don't understand full outer joins....

2005-01-25 Thread Stephan Szabo
On Tue, 25 Jan 2005, Ben wrote: > I run this: > > select > coalesce(a.n,0) as a, > coalesce(b.n,0) as b, > coalesce(a.s,b.s) as s > from > ( select 1 as n, 0 as s) a full outer join > ( select 2 as n, 1 as s) b > on > a.s = b.s > > ... and get this: > > a | b |

Re: [GENERAL] Apparently I don't understand full outer joins....

2005-01-25 Thread Richard Poole
On Tue, Jan 25, 2005 at 12:29:07PM -0800, Ben wrote: > 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 >

Re: [GENERAL] Apparently I don't understand full outer joins....

2005-01-25 Thread Thomas F . O'Connell
Your second example is breaking the syntax of from_item ( see ). Your join_condition has to be applied to the two from_items associated by join_type. I don't think multiple join_conditions can be applied sequentially the way you're try