Re: highest match in group - Mailing list pgsql-general

From Dave [Hawk-Systems]
Subject Re: highest match in group
Date
Msg-id DBEIKNMKGOBGNDHAAKGNKELCHNAC.dave@hawk-systems.com
Whole thread Raw
In response to Re: highest match in group  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
>"Dave [Hawk-Systems]" <dave@hawk-systems.com> writes:
>> have a data table that records entries by date(unix timestamp) and customer
>> number.  each custnum will have several entries showing a running
>ledger type
>> snapshot.  we have the need to get the most recent entry from not
>one, but all
>> unique customers, in the most cost effective manner.
>
>If you don't mind using a Postgres-only construct, SELECT DISTINCT ON
>is made for this.  See the "weather report" example in the SELECT
>reference page.

thanks Tom, had a forest for the trees problem there and that put me on the
right track.

Dave



pgsql-general by date:

Previous
From: Bret Busby
Date:
Subject: Re: [NOVICE] PostgreSQL Training
Next
From: "Keith C. Perry"
Date:
Subject: Re: [NOVICE] PostgreSQL Training