Re: Combine query views into one SQL string - Mailing list pgsql-sql

From Nils Zonneveld
Subject Re: Combine query views into one SQL string
Date
Msg-id 3B988C82.9C4782E4@mbit.nl
Whole thread Raw
In response to Re: Combine query views into one SQL string  ("Maik" <K.Maik@web.de>)
List pgsql-sql

Maik wrote:
> 
> Its clear, union concat the two results.
> 
> But he can also use this join version, if its the intention.
> 
> select t1.id, sum(t1.amount), t2.id, sum(t2.amount) from table1 as t1,
> table2 as t2 where t1.id=t2.id;
> 

Yeps, thats another way to write an inner join :-)

Mazzel,

Nils

-- 
Alles van waarde is weerloos
Lucebert


pgsql-sql by date:

Previous
From: "Advid@newgen"
Date:
Subject: Urgent: How to set autocommit off in postgres.........
Next
From: olle.wijk@systecon.se (Olle Wijk)
Date:
Subject: How do I extract ONE particular field, when multiple table contain the same field name?