Re: Where clause

From: Richard Huxton <dev(at)archonet(dot)com>
To: Michael Landin Hostbaek <mich(at)the-lab(dot)org>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Where clause
Date: 2007-06-26 10:45:21
Message-ID: 4680EE41.3020200@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Glaesemann 2007-06-26 12:56:30 Re: yet another simple SQL question
Previous Message Achilleas Mantzios 2007-06-26 10:31:03 Re: Where clause