| From: | Mark Fenbers <mark(dot)fenbers(at)noaa(dot)gov> |
|---|---|
| To: | Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> |
| Cc: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: complex query |
| Date: | 2012-10-28 01:56:05 |
| Message-ID: | 508C90B5.3060308@noaa.gov |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
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.
Thanks! Your idea worked like a champ!
Mark
| Attachment | Content-Type | Size |
|---|---|---|
| unknown_filename | text/html | 685 bytes |
| mark_fenbers.vcf | text/x-vcard | 347 bytes |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Scott Marlowe | 2012-10-28 02:20:50 | Re: complex query |
| Previous Message | Scott Marlowe | 2012-10-28 00:24:32 | Re: complex query |