Re: count function alternative in postgres - Mailing list pgsql-general

From Tom Lane
Subject Re: count function alternative in postgres
Date
Msg-id 20647.1270311446@sss.pgh.pa.us
Whole thread Raw
In response to count function alternative in postgres  (junaid malik <junaidmalik14@gmail.com>)
List pgsql-general
junaid malik <junaidmalik14@gmail.com> writes:
> Is there any alternative of mysql function COUNT(DISTINCT expr,
> [expr...]) in postgres. We get error if we

The SQL-standard way to do that would be

select count(*) from (select distinct expr,expr,... from ...) as ss;

COUNT with multiple arguments is not anywhere in the standard.

            regards, tom lane

pgsql-general by date:

Previous
From: junaidmalik14
Date:
Subject: count function alternative in postgres
Next
From: raghavendra t
Date:
Subject: ERROR: cache lookup failed for relation X