FIRST_VALUE argument must appear in group by? - Mailing list pgsql-general

From Guyren Howe
Subject FIRST_VALUE argument must appear in group by?
Date
Msg-id C7F93FD9-A087-434D-A05F-F5F85F2BC7AF@gmail.com
Whole thread Raw
Responses Re: FIRST_VALUE argument must appear in group by?  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
I have this SELECT clause as part of a larger query:
FIRST_VALUE(drs.id) OVER (PARTITION BY drs.order_ID ORDER BY drs.position ASC) AS current_drs_id
Seems reasonable to me: group and sort the fields in this table and give me the first value.

But I get "column "drs.id" must appear in the GROUP BY clause or be used in an aggregate function".

Huh?

pgsql-general by date:

Previous
From: Steve Kehlet
Date:
Subject: Re: preventing ERROR: multixact "members" limit exceeded
Next
From: "David G. Johnston"
Date:
Subject: Re: FIRST_VALUE argument must appear in group by?