Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 25A26477797 for ; Tue, 9 Jul 2002 06:04:39 -0400 (EDT) Mailbox-Line: From david.bouriaud@ac-rouen.fr Tue Jul 9 06:04:39 2002 Received: from necker.ac-rouen.fr (smtp.ac-rouen.fr [194.167.110.3]) by postgresql.org (Postfix) with ESMTP id D84C747756D for ; Tue, 9 Jul 2002 04:30:13 -0400 (EDT) Received: from s2ia27 (localhost.localdomain [127.0.0.1]) by necker.ac-rouen.fr (8.11.0/8.11.0) with ESMTP id g698UBw01261 for ; Tue, 9 Jul 2002 10:30:11 +0200 Content-Type: text/plain; charset="us-ascii" From: David BOURIAUD Organization: Inspection =?iso-8859-1?q?acad=E9mique=20de?= l'Eure To: pgsql-sql@postgresql.org Subject: SQL problem with aggregate functions. Date: Tue, 9 Jul 2002 10:36:17 +0200 X-Mailer: KMail [version 1.4] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200207091036.17913.david.bouriaud@ac-rouen.fr> X-Spam-Status: No, hits=0.0 required=5.0 tests=none version=2.30 X-Spam-Level: X-Archive-Number: 200207/105 X-Sequence-Number: 8484 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