Re: GROUP and ORDER BY

From: Robins Tharakan <robins(dot)tharakan(at)comodo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Cc: Tarlika Elisabeth Schmitz <postgresql6(at)numerixtechnology(dot)de>
Subject: Re: GROUP and ORDER BY
Date: 2011-11-08 15:03:18
Message-ID: 4EB944B6.7030905@comodo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hmmm... Missed that!

I think you are looking for the feature that was introduced in
PostgreSQL 9.1 where you could have a non-group-by column in the select
list, but only if the group-by has a pkey to identify the actual row.

http://www.postgresql.org/docs/9.1/static/release-9-1.html
(Search for GROUP BY)

--
Robins Tharakan

On 11/08/2011 03:29 PM, Tarlika Elisabeth Schmitz wrote:
> Thank you for yuor suggestion, Robins. Unfortunately, it does not work;
> this returns:
> 1787 "Toomyvara" 0.5
> 1787 "Toomevara" 0.4
> 1188 "Toonybara" 0.4
> because while column "no" is identical, "name" isn't and you're
> grouping by both of them.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sylvain Mougenot 2011-11-08 16:04:39 Re: Partitionning + Trigger and Execute not working as expected
Previous Message tlund79 2011-11-08 13:16:53 Issue with a variable in a function