Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 57D59636A00 for ; Tue, 6 Apr 2010 15:09:16 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 87994-01-8 for ; Tue, 6 Apr 2010 18:09:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 425F163554E for ; Tue, 6 Apr 2010 14:39:39 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NzCkU-0004K4-2g for pgsql-sql@postgresql.org; Tue, 06 Apr 2010 19:39:38 +0200 Received: from ppp-188-174-5-195.dynamic.mnet-online.de ([188.174.5.195]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Apr 2010 19:39:38 +0200 Received: from spam_eater by ppp-188-174-5-195.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Apr 2010 19:39:38 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Thomas Kellerer Subject: Re: count function alternative in postgres Date: Tue, 06 Apr 2010 19:39:31 +0200 Lines: 21 Message-ID: References: <28126792.post@talk.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: ppp-188-174-5-195.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: <28126792.post@talk.nabble.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.384 tagged_above=-10 required=5 tests=AWL=-0.385, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201004/8 X-Sequence-Number: 33935 junaidmalik14 wrote on 03.04.2010 14:58: > > 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 > > Thanks Your question has been answered several times already (including this list) http://archives.postgresql.org/pgsql-hackers/2010-04/msg00182.php http://archives.postgresql.org/pgsql-hackers/2010-04/msg00179.php http://forums.devshed.com/postgresql-help-21/count-function-alternative-in-postgres-691450.html http://www.dbforums.com/postgresql/1655165-count-function-alternative-postgres.html