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

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Why does "group by" need to match select fields?
Дата
Msg-id 20070301164823.GC1705@svana.org
обсуждение исходный текст
Ответ на Re: Why does "group by" need to match select fields?  (Omar Eljumaily <omar2@omnicode.com>)
Список 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 special case of max/min, you can use things like ORDER
BY/LIMIT to acheive the effect you want. And DISTINCT ON () is also
useful in such situations.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: George Nychis
Дата:
Сообщение: Re: creating a function with a variable table name
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Why does "group by" need to match select fields?