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: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql

> 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


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-2017 The PostgreSQL Global Development Group