Re: [GENERAL] count function alternative in postgres

2010-04-05 Thread Tom Lane
Merlin Moncure writes: > On Sat, Apr 3, 2010 at 3:02 PM, Scott Bailey wrote: >> SELECT COUNT( DISTINCT row(col1, col2, col3) ) FROM foo > very clever! This is similar to how I use rowtypes to get around the > single column restrictions on function calls in the select field list. Cute, but note

Re: [GENERAL] count function alternative in postgres

2010-04-05 Thread Merlin Moncure
On Sat, Apr 3, 2010 at 3:02 PM, Scott Bailey wrote: > junaid malik 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 my

Re: [GENERAL] count function alternative in postgres

2010-04-03 Thread Scott Bailey
junaid malik 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.

Re: [GENERAL] count function alternative in postgres

2010-04-03 Thread Tom Lane
junaid malik 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

[GENERAL] count function alternative in postgres

2010-04-03 Thread junaidmalik14
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-functi

[GENERAL] count function alternative in postgres

2010-04-03 Thread junaid malik
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-function