Re: Where clause - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Where clause
Date
Msg-id 4680EE41.3020200@archonet.com
Whole thread Raw
In response to Re: Where clause  (Michael Landin Hostbaek <mich@the-lab.org>)
List pgsql-sql
Michael Landin Hostbaek wrote:
> 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.

... GROUP BY cid

--   Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: Where clause
Next
From: Michael Glaesemann
Date:
Subject: Re: yet another simple SQL question