Re: big distinct clause vs. group by

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 19, 2011 at 11:07 AM, Robert Klemme
<shortcutter@xxxxxxxxxxxxxx> wrote:
> I find that slightly contradictory: either you do care about the
> values then your business requirements dictate the aggregate function.
>  If you only want to pick any value actually in the table but do not
> care about which one (e.g. MIN or MAX or any other) then you don't
> actually care about the value.  Because "SELECT a, MAX(b) ... GROUP BY
> a" and "SELECT a, MIN(b) ... GROUP BY a" are not equivalent.  And, if
> you do not care then there is probably no point in selecting them at
> all.  At best you could use a constant for any legal value then.

I know it sounds weird, but there are at times when you only want one
of the actual values - but don't care which one precisely.

It happened to me at least once.

So, it may sound as nonsense, but it is probably not. Just uncommon.

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux