Re: UNION question

From: "Hartman, Matthew" <Matthew(dot)Hartman(at)krcc(dot)on(dot)ca>
To: "Hartman, Matthew" <Matthew(dot)Hartman(at)krcc(dot)on(dot)ca>, "Brandon Metcalf" <brandon(at)geronimoalloys(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: UNION question
Date: 2009-07-10 16:27:44
Message-ID: 366642367C5B354197A1E0D27BC175BD02259891@KGHMAIL.KGH.ON.CA
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-
> > owner(at)postgresql(dot)org] On Behalf Of Brandon Metcalf
> > Sent: Friday, July 10, 2009 12:16 PM
>
> Change it to this:

Sorry, I forgot that you need to split the GROUP BY clause as well in a
similar manner to the WHERE clause. And unless you have duplicate rows
to eliminate, use UNION ALL rather than UNION for a speed increase.

Matthew Hartman
Programmer/Analyst
Information Management, ICP
Kingston General Hospital
.now.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-07-10 16:29:00 Re: UNION question
Previous Message Hartman, Matthew 2009-07-10 16:23:42 Re: UNION question