Skip site navigation (1) Skip section navigation (2)

Re: DISTINCT ON troubles

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: <jer(at)highboard(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: DISTINCT ON troubles
Date: 2004-02-19 19:28:51
Message-ID: 200402191128.51124.josh@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-sql
Jeremy,

> Am I just approaching this all wrong and need to create a temporary table
> and draw from that, or is there a way to salvage this query?

Think about using a subquery instead of the DISTINCT ON approach.   I don't 
think you can get what you want with DISTINCT ON.

A temporary table is not necessary.


-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco


In response to

Responses

pgsql-sql by date

Next:From: Jeremy SmithDate: 2004-02-19 19:34:39
Subject: Re: DISTINCT ON troubles
Previous:From: Josh BerkusDate: 2004-02-19 19:26:26
Subject: Re: Compiling pl/pgsql functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group