Received: from relay03.cablecom.net (relay03.cablecom.net [62.2.33.103]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1NFsex53734 for ; Fri, 23 Feb 2001 10:54:40 -0500 (EST) (envelope-from olaf.zanger@soli-con.com) Received: from mail.swissonline.ch (mail.swissonline.ch [62.2.32.83]) by relay03.cablecom.net (8.11.1/8.11.0/SOL/MXRELAY-1.03) with ESMTP id f1NFsZE30089; Fri, 23 Feb 2001 16:54:35 +0100 (CET) Received: from soli-con.com (dclient164-21.hispeed.ch [62.2.164.21]) by mail.swissonline.ch (8.11.1/8.11.0/MSOL-2.17) with ESMTP id f1NFsZv11694; Fri, 23 Feb 2001 16:54:35 +0100 (MET) Message-ID: <3A96888E.2292D998@soli-con.com> Date: Fri, 23 Feb 2001 16:58:06 +0100 From: Olaf Zanger Reply-To: olaf.zanger@soli-con.com Organization: soli-con Engineering Zanger X-Mailer: Mozilla 4.73 [de]C-CCK-MCD QXW0323w (Win98; U) X-Accept-Language: de,en MIME-Version: 1.0 To: Tod McQuillin CC: pgsql-sql@postgresql.org Subject: Re: sum(bool)? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200102/358 X-Sequence-Number: 1557 hi there, soooo cool, this works streight away and took 5 min. waiting for a answer :-) thanks very much to you tod personal and the mailing list for existence. Olaf Tod McQuillin schrieb: > > On Fri, 23 Feb 2001, Olaf Zanger wrote: > > > i'd like to add up the "true" values of a comparison like > > > > sum(a>b) > > > > it just doesn't work like this > > Try > > sum(case when a>b then 1 else 0 end) > -- > Tod McQuillin -- soli-con Engineering Zanger Dipl.-Ing. (FH) Olaf Marc Zanger Lorrainestrasse 23 3013 Bern / Switzerland Fon: +41-31-332 9782 Mob: +41-76-572 9782 mailto:info@soli-con.com mailto:olaf.zanger@soli-con.com http://www.soli-con.com