Re: Why does "group by" need to match select fields?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Omar Eljumaily <omar2(at)omnicode(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why does "group by" need to match select fields?
Date: 2007-03-01 16:49:20
Message-ID: 20070301164920.GD1705@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Feb 28, 2007 at 04:57:08PM -0800, Omar Eljumaily wrote:
> OK, I see what's going on. I can have more than one max(amount) with
> the same amount and payee. Thanks so much. Like I said, it's sort of
> dogged me off and on many times.

Note that in the case of min/max you can use ORDER BY/LIMIT or DISTINCT
ON () to acheive the effect you want.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2007-03-01 16:52:52 Re: creating a function with a variable table name
Previous Message Martijn van Oosterhout 2007-03-01 16:48:23 Re: Why does "group by" need to match select fields?