Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Where clause



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group