On Sat, Apr 3, 2010 at 8:59 AM, 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)
> but it works well in mysql.
>
> Reference url is given below
>
> http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html#function_count-distinct
You can do:
SELECT COUNT(*) FROM (SELECT DISTINCT profile.id, profile.name,
profile.age FROM ...) x;
...Robert