Re: count function alternative in postgres

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "junaidmalik14" <junaidmalik14(at)gmail(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: count function alternative in postgres
Date: 2010-04-05 14:47:20
Message-ID: 4BB9B1A80200002500030457@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

junaidmalik14 <junaidmalik14(at)gmail(dot)com> wrote:

> Is there any alternative of mysql function COUNT(DISTINCT
> expr,[expr...]) in postgres. We get error if we write count like
> this count(distinct profile.id, profile.name, profile.age)

Is that semantically different from this SQL standard syntax?:

SELECT profile.id, profile.name, profile.age, COUNT(*)
FROM profile
GROUP BY profile.id, profile.name, profile.age;

-Kevin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-04-05 15:43:52 Re: Autonomous transaction
Previous Message Tom Lane 2010-04-05 14:35:19 Re: [SPAM]Re: Questions about 9.0 release note