Difficult query (for me)

From: sylfanie(at)club-internet(dot)fr (Stephane)
To: pgsql-sql(at)postgresql(dot)org
Subject: Difficult query (for me)
Date: 2003-04-04 20:06:22
Message-ID: 4ff986f9.0304041206.1ae7b97a@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

Basicaly I have two tables like this:

Table 1
RecordName Value
a 100
b 100
c 100
d 100
e 100
f 100

Table 2
RecordName Value
a 25
b 50
c 75
g 150
h 150

I would like a query that give me a result like this:
a 75 (100-25)
b 50 (100-50)
c 25
d 100
e 100
f 100
g -150
h -150

It is table1-table2.
I could do it for records a,b,c but I do not how to have record which
are only in one of the two tables.
Thanks for your help.
Stephane.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Claude 2003-04-04 20:18:38 timestamp with postgresql 7.3
Previous Message Raj Arya 2003-04-04 19:57:17 unsubscribe