Re: Just 1 in a series... - Mailing list pgsql-sql

From Tom Lane
Subject Re: Just 1 in a series...
Date
Msg-id 3720.1133544030@sss.pgh.pa.us
Whole thread Raw
In response to Just 1 in a series...  (Mark Fenbers <Mark.Fenbers@noaa.gov>)
Responses Re: Just 1 in a series...  (Mark Fenbers <Mark.Fenbers@noaa.gov>)
List pgsql-sql
Mark Fenbers <Mark.Fenbers@noaa.gov> writes:
> ... However, I only want the first occurrence of a such a series (where the 
> event_id is the same), what SQL syntax should I use to do this? 

You might find the "DISTINCT ON" syntax does just what you want --- see
the "weather report" example on the SELECT reference page.  It's not
standard SQL though.
        regards, tom lane


pgsql-sql by date:

Previous
From: Mark Fenbers
Date:
Subject: Just 1 in a series...
Next
From: Mark Fenbers
Date:
Subject: Re: Just 1 in a series...