From: Albrecht Berger <berger1517@gmx.ch>
To: pgsql <pgsql-sql@postgresql.org>
Subject: Re: sql group by statement
Date: Fri, 13 Sep 2002 12:39:46 +0200
Message-ID: <006501c25b11$e30914b0$a07ba8c0@wxp> (raw)
References: <002f01c25b10$6db4b940$a07ba8c0@wxp>
<3D81BF17.4030609@mail.ru>
but how do I know that "distinct on" doesn't cut off
the row with max(val2) of that id that I need ?
> see the yesterday's thread about DISTINCT ON (non-standard Postgres
feature)
>
> > I have a problem, which I'm not able to solve with a simple query :
> >
> > I need a resultset with distinct id's, but the max val2 of each id.
> > I tried to group by id, but though I need the pk in my resultset
> > I have to group it too, which "destroys" the group of val2.
>
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: berger1517@gmx.ch
Subject: Re: sql group by statement
In-Reply-To: <006501c25b11$e30914b0$a07ba8c0@wxp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox