Re: select distinct() question - Mailing list pgsql-novice

From Tom Lane
Subject Re: select distinct() question
Date
Msg-id 1845.1050645291@sss.pgh.pa.us
Whole thread Raw
In response to select distinct() question  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
List pgsql-novice
Jean-Christian Imbeault <jc@mega-bucks.co.jp> writes:
> I observed the following for one of my queries:
> TEST=# select distinct(prod_id), date_received from invoice_li;
> ...
> Is this the correct behaviour for a select distinct()?

Yes.  Hint: the parentheses in what you wrote are noise.

Possibly you were looking for DISTINCT ON, which does have
a parenthetical list of things-to-distinctify.

            regards, tom lane


pgsql-novice by date:

Previous
From: "paul butler"
Date:
Subject: Re: select distinct() question
Next
From: "Jay G. Scott"
Date:
Subject: i guess i can't code in C...