Join required?? - Mailing list pgsql-novice

From Timo Tuomi
Subject Join required??
Date
Msg-id Pine.LNX.4.04.10103181338110.8635-100000@hangar.keskiespoo.net
Whole thread Raw
Responses Re: Join required??
List pgsql-novice

testdb=>
testdb=> select * from test1;

c|i
-+-
A|2
B|3
C|4
(3 rows)

testdb=> select * from test2;

c|i
-+-
A|6
C|7
(2 rows)

testdb=>

I'd like to get (test1.i + test2.i) like this:

c|sum
-+---
A|8
B|3
C|11


i.e. to sum the rows but if one of the rows doesn't exist on one of the tables
then print just the existing row. How can I do this with postgresql-6.5.3?


Thanks in advance,
Timo T.


pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: voodoo index usage ;)
Next
From: Lars Forseth
Date:
Subject: Postgres - trouble starting the database on a suse 7.0 box - data dir not found