Re: How should I do this? - Mailing list pgsql-general

From Laurent Duperval
Subject Re: How should I do this?
Date
Msg-id afhkda$1sjg$1@news.hub.org
Whole thread Raw
In response to Re: How should I do this?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
In <20020628121755.A15733@svana.org>, Martijn van Oosterhout wrote:
> Ah right. The problem is that DISTINCT ON requires that the fields be
> distincted on be the same and the first few fields being sorted by. In the
> hypothetical case you could do:
>
> select distinct on (col2) select * from a order by col1;
>
> But that isn't allowed. Maybe you will be a stored procedure or something.

I ended up doing this on the client side because there isn't a way for the
DB to know what I'm trying to do. I also wrote the cleanup stuff on the
client side and everything is working up to specs.

Thanks!

L

--
Laurent Duperval <mailto:laurent.duperval@masq.ca>

Why are there flotation devices under plane seats instead of parachutes?



pgsql-general by date:

Previous
From: "Tomis³aw Kityñski"
Date:
Subject: Re: Wildcards in GROUP BY?
Next
From: Michael Meskes
Date:
Subject: Re: ecpg help