Re: select distinct() question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: select distinct() question
Date: 2003-04-18 05:54:51
Message-ID: 1845.1050645291@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message phil campaigne 2003-04-18 16:50:47 String index out of range
Previous Message paul butler 2003-04-18 05:28:21 Re: select distinct() question