pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Fenbers <mark.fenbers@noaa.gov>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: complex query
Date: Sat, 27 Oct 2012 21:56:05 -0400
Message-ID: <508C90B5.3060308@noaa.gov> (raw)
In-Reply-To: <CAOR=d=17g1mnKENbJDTiKb-7_JptrdSE43Lz=WF+XmNL9R1akw@mail.gmail.com>
References: <508C75D1.2070906@noaa.gov>
	<CAOR=d=17g1mnKENbJDTiKb-7_JptrdSE43Lz=WF+XmNL9R1akw@mail.gmail.com>

This is a multi-part message in MIME format.
--------------030209020201040806020004
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFCC" text="#000000">
    <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!&nbsp; Your idea worked like a champ!<br>
    Mark<br>
    <br>
  </body>
</html>

--------------030209020201040806020004
Content-Type: text/x-vcard; charset=utf-8;
 name="mark_fenbers.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="mark_fenbers.vcf"

begin:vcard
fn:Mark Fenbers
n:Fenbers;Mark
org:Ohio River Forecast Center;Hydrometeorological Analysis & Support Unit
adr:1901 South OH-134;;National Weather Service;Wilmington;OH;45177-9708;USA
email;internet:Mark.Fenbers@noaa.gov
title:Senior Meteorologist
tel;work:937-383-0430
tel;fax:937-383-0033
url:weather.gov/ohrfc
version:2.1
end:vcard


--------------030209020201040806020004--




Attachments:

  [text/x-vcard] mark_fenbers.vcf (345B, ../508C90B5.3060308@noaa.gov/2-mark_fenbers.vcf)
  download | inline:
begin:vcard
fn:Mark Fenbers
n:Fenbers;Mark
org:Ohio River Forecast Center;Hydrometeorological Analysis & Support Unit
adr:1901 South OH-134;;National Weather Service;Wilmington;OH;45177-9708;USA
email;internet:Mark.Fenbers@noaa.gov
title:Senior Meteorologist
tel;work:937-383-0430
tel;fax:937-383-0033
url:weather.gov/ohrfc
version:2.1
end:vcard

view thread (8+ messages)  latest in thread

Message-ID: <508C90B5.3060308@noaa.gov>
Permalink:  ../508C90B5.3060308@noaa.gov/
Also on:    postgresql.org/message-id/508C90B5.3060308@noaa.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mark.fenbers@noaa.gov, scott.marlowe@gmail.com
  Subject: Re: complex query
  In-Reply-To: <508C90B5.3060308@noaa.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox