Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 77FEC9FB8CD for ; Tue, 26 Jun 2007 06:44:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 46849-03 for ; Tue, 26 Jun 2007 06:44:55 -0300 (ADT) X-Greylist: delayed 01:20:47.612652 by SQLgrey-1.7.5 Received: from mail2.itxmarket.com (fw.itxmarket.com [84.14.136.210]) by postgresql.org (Postfix) with ESMTP id 4671A9FB82A for ; Tue, 26 Jun 2007 06:44:55 -0300 (ADT) Received: from icommerce.fr (mich2.itxmarket.com [192.168.2.26]) by mail2.itxmarket.com (Postfix) with ESMTP id 50FE961CD7; Tue, 26 Jun 2007 11:44:53 +0200 (CEST) Received: by icommerce.fr (Postfix, from userid 1001) id 48F782284D; Tue, 26 Jun 2007 11:44:53 +0200 (CEST) Date: Tue, 26 Jun 2007 11:44:53 +0200 From: Michael Landin Hostbaek To: "A. Kretschmer" Cc: pgsql-sql@postgresql.org Subject: Re: Where clause Message-ID: <20070626094453.GH67974@mich2.itxmarket.com> Mail-Followup-To: Michael Landin Hostbaek , "A. Kretschmer" , pgsql-sql@postgresql.org References: <20070626082405.GA67974@mich2.itxmarket.com> <20070626090140.GB28610@a-kretschmer.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070626090140.GB28610@a-kretschmer.de> X-Operating-System: FreeBSD 6.2-STABLE i386 X-PGP-Key: http://www.freebsdcluster.org/~mich/ User-Agent: Mutt/1.5.15 (2007-04-06) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.043 tagged_above=0 required=5 tests=AWL=0.093, BAYES_40=-0.185, FORGED_RCVD_HELO=0.135 X-Spam-Level: X-Archive-Number: 200706/215 X-Sequence-Number: 28705 A. Kretschmer (andreas.kretschmer) writes: > *untested* > > select cid, sum(case when click = true then 1 else 0 end), sum(case when > view = true then 1 else 0 end) from ... > Thanks, but I need the DISTINCT contactid - I don't want the same contactid counted twice. Mike