Re: DISTINCT ON troubles - Mailing list pgsql-sql

From Josh Berkus
Subject Re: DISTINCT ON troubles
Date
Msg-id 200402191128.51124.josh@agliodbs.com
Whole thread Raw
In response to DISTINCT ON troubles  ("Jeremy Smith" <jer@highboard.com>)
Responses Re: DISTINCT ON troubles
List 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 BerkusAglio Database SolutionsSan Francisco



pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Compiling pl/pgsql functions
Next
From: "Jeremy Smith"
Date:
Subject: Re: DISTINCT ON troubles