Grzegorz Jaśkiewicz wrote:
On Tue, Dec 9, 2008 at 9:02 AM, Grzegorz Jaśkiewicz <[EMAIL PROTECTED]> wrote:
or even, when you change bar to proper type - that is, timestamp
SELECT distinct foo, min(bar) as minbar, max(bar) as maxbar FROM
table WHERE bar < '2008-12-07
16:32:46' AND tbl_id=153 OR
Grzegorz Jaśkiewicz wrote:
On Mon, Dec 8, 2008 at 10:19 PM, Madison Kelly <[EMAIL PROTECTED]> wrote:
Hi all,
I've got a table that I am trying to SELECT DISTINCT on one column and
ORDER BY on a second column, but am getting the error:
SELECT DISTINCT ON expressions must match initial ORDER BY
On Tue, Dec 9, 2008 at 9:02 AM, Grzegorz Jaśkiewicz <[EMAIL PROTECTED]> wrote:
> or even, when you change bar to proper type - that is, timestamp
>
> SELECT distinct foo, min(bar) as minbar, max(bar) as maxbar FROM
> table WHERE bar < '2008-12-07
> 16:32:46' AND tbl_id=153 ORDER BY bar LIMIT 1;
On Mon, Dec 8, 2008 at 10:19 PM, Madison Kelly <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I've got a table that I am trying to SELECT DISTINCT on one column and
> ORDER BY on a second column, but am getting the error:
>
> SELECT DISTINCT ON expressions must match initial ORDER BY expressions
try
SE
Adam Rich Wrote:
> > >
> > > When we get windowing functions, a lot of this pain will go away :)
> > >
> >
> > Yes! Hope it won't be too long now. The patch seems to behave like it
> > should
> > now :)
> > Hopefully we'll see it commited for 8.4.
> >
> > Though this does not look too much cleaner
> >
> > When we get windowing functions, a lot of this pain will go away :)
> >
>
> Yes! Hope it won't be too long now. The patch seems to behave like it
> should
> now :)
> Hopefully we'll see it commited for 8.4.
>
> Though this does not look too much cleaner at least it's standard SQL:
>
> A
>>> Sent: 08 December 2008 22:19
> >>> To: pgsql-general@postgresql.org
> >>> Subject: [GENERAL] SELECT DISTINCT ... ORDER BY problem
> >>>
> >>> Hi all,
> >>>
> >>>I've got a table that I am trying to SELECT D
> -Original Message-
> From: David Fetter [mailto:[EMAIL PROTECTED]
> Sent: 09 December 2008 00:55
> To: David Rowley
> Cc: 'Madison Kelly'; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] SELECT DISTINCT ... ORDER BY problem
>
> On Mon, Dec 0
DISTINCT ... ORDER BY problem
Hi all,
I've got a table that I am trying to SELECT DISTINCT on one column
and ORDER BY on a second column, but am getting the error:
SELECT DISTINCT ON expressions must match initial ORDER BY expressions
I can't add the second column to the DISTINCT clau
> > Subject: [GENERAL] SELECT DISTINCT ... ORDER BY problem
> >
> > Hi all,
> >
> >I've got a table that I am trying to SELECT DISTINCT on one column
> > and ORDER BY on a second column, but am getting the error:
> >
> > SELECT DISTINCT ON exp
David Rowley wrote:
-Original Message-
From: [EMAIL PROTECTED] [mailto:pgsql-general-
[EMAIL PROTECTED] On Behalf Of Madison Kelly
Sent: 08 December 2008 22:19
To: pgsql-general@postgresql.org
Subject: [GENERAL] SELECT DISTINCT ... ORDER BY problem
Hi all,
I've got a table that
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:pgsql-general-
> [EMAIL PROTECTED] On Behalf Of Madison Kelly
> Sent: 08 December 2008 22:19
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] SELECT DISTINCT ... ORDER BY problem
>
> Hi all,
>
>
Hi all,
I've got a table that I am trying to SELECT DISTINCT on one column
and ORDER BY on a second column, but am getting the error:
SELECT DISTINCT ON expressions must match initial ORDER BY expressions
I can't add the second column to the DISTINCT clause because every
row is unique. L
13 matches
Mail list logo