pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David BOURIAUD <david.bouriaud@ac-rouen.fr>
To: pgsql-sql@postgresql.org
Subject: SQL problem with aggregate functions.
Date: Tue, 9 Jul 2002 10:36:17 +0200
Message-ID: <200207091036.17913.david.bouriaud@ac-rouen.fr> (raw)

Hi the list !
I've got a table in which there is a field that can have one amongst 3 
possible values : D, R, X. Is it possible to get in one query the count of 
this different values.Please, note that I don't want to have a querry like 
this :
"select count (*) from tab group by f1;", cause i want to get all the possible 
count values in one row (these data are already grouped on another field).
To give a more accurate example, here is what I want to retrieve :

Field group | count of D | count of R | count of X.

Any clues ?
-- 
David BOURIAUD
----------------------------------------------------------
In a world without walls or fences, what use do we have 
for windows or gates ?
----------------------------------------------------------
ICQ#102562021






view thread (5+ messages)  latest in thread

Message-ID: <200207091036.17913.david.bouriaud@ac-rouen.fr>
Permalink:  ../200207091036.17913.david.bouriaud@ac-rouen.fr/
Also on:    postgresql.org/message-id/200207091036.17913.david.bouriaud@ac-rouen.fr

 · 

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: david.bouriaud@ac-rouen.fr
  Subject: Re: SQL problem with aggregate functions.
  In-Reply-To: <200207091036.17913.david.bouriaud@ac-rouen.fr>

* 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