pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Michael Landin Hostbaek <mich@the-lab.org>
To: A. Kretschmer <andreas.kretschmer@schollglas.com>
To: pgsql-sql@postgresql.org
Subject: Re: Where clause
Date: Tue, 26 Jun 2007 11:45:21 +0100
Message-ID: <4680EE41.3020200@archonet.com> (raw)
In-Reply-To: <20070626094453.GH67974@mich2.itxmarket.com>
References: <20070626082405.GA67974@mich2.itxmarket.com>
	<20070626090140.GB28610@a-kretschmer.de>
	<20070626094453.GH67974@mich2.itxmarket.com>

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



view thread (10+ messages)  latest in thread

Message-ID: <4680EE41.3020200@archonet.com>
Permalink:  ../4680EE41.3020200@archonet.com/
Also on:    postgresql.org/message-id/4680EE41.3020200@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, mich@the-lab.org, andreas.kretschmer@schollglas.com
  Subject: Re: Where clause
  In-Reply-To: <4680EE41.3020200@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox