Re: a bit confused about distinct() function - Mailing list pgsql-sql

From Tom Lane
Subject Re: a bit confused about distinct() function
Date
Msg-id 24286.1238348947@sss.pgh.pa.us
Whole thread Raw
In response to a bit confused about distinct() function  ("Tena Sakai" <tsakai@gallo.ucsf.edu>)
List pgsql-sql
"Tena Sakai" <tsakai@gallo.ucsf.edu> writes:
> I am a bit confused about distinct() function.

Your confusion is in thinking that DISTINCT is a function.  It is not;
it's just a keyword that modifies SELECT.  Write
select distinct subjectid, markerid, allele1id, allele2idfrom tsakai.mygenotype2...

The other syntax was being read as an implicit row constructor, like
select distinct row(subjectid, markerid, allele1id, allele2id)

which actually will work in PG 8.4, but does not in existing releases;
and you likely wouldn't like the output format anyway, since it would
just be one composite column.
        regards, tom lane


pgsql-sql by date:

Previous
From: Osvaldo Kussama
Date:
Subject: Re: a bit confused about distinct() function
Next
From: "Tena Sakai"
Date:
Subject: Re: a bit confused about distinct() function