Re: complex query - Mailing list pgsql-sql

From Mark Fenbers
Subject Re: complex query
Date
Msg-id 508C90B5.3060308@noaa.gov
Whole thread Raw
In response to Re: complex query  (Scott Marlowe <scott.marlowe@gmail.com>)
Responses Re: complex query
List pgsql-sql
<blockquote cite="mid:CAOR=d=17g1mnKENbJDTiKb-7_JptrdSE43Lz=WF+XmNL9R1akw@mail.gmail.com" type="cite"><pre wrap="">
I'd do somethings like:

select * from (   select id, sum(col1), sum(col2) from tablename group by yada  ) as a [full, left, right, outer] join
(  select id, sum(col3), sum(col4) from tablename group by bada   ) as b
 
on (a.id=b.id);

and choose the join type as appropriate.</pre></blockquote> Thanks!  Your idea worked like a champ!<br /> Mark<br /><br
/>

pgsql-sql by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: complex query
Next
From: Scott Marlowe
Date:
Subject: Re: complex query