Received: from imr1.ericy.com (imr1.ericy.com [208.237.135.240]) by hub.org (8.10.1/8.11.0) with ESMTP id e9JIUhn84527 for ; Thu, 19 Oct 2000 14:30:44 -0400 (EDT) (envelope-from danw@netmanager7.rtp.ericsson.se) Received: from mr5.exu.ericsson.se (mr5u3.ericy.com [208.237.135.124]) by imr1.ericy.com (8.9.3/8.9.3) with ESMTP id NAA04941 for ; Thu, 19 Oct 2000 13:30:40 -0500 (CDT) Received: from netmanager7.rtp.ericsson.se (netmanager7.rtp.ericsson.se [147.117.133.252]) by mr5.exu.ericsson.se (8.10.2/8.10.2) with ESMTP id e9JIT0k10735 for ; Thu, 19 Oct 2000 13:29:00 -0500 (CDT) Received: from satdsp14.ericsson.COM (satdsp14.rtp.ericsson.se [147.117.84.7]) by netmanager7.rtp.ericsson.se (8.8.8+Sun/8.6.4) with ESMTP id OAA17107 for ; Thu, 19 Oct 2000 14:30:39 -0400 (EDT) Received: (from danw@localhost) by satdsp14.ericsson.COM (8.9.1b+Sun/8.9.1) id OAA02526; Thu, 19 Oct 2000 14:30:38 -0400 (EDT) From: Daniel Wickstrom MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14831.15805.753626.426101@gargle.gargle.HOWL> Date: Thu, 19 Oct 2000 14:30:21 -0400 (EDT) To: pgsql-sql@postgresql.org Subject: Re: COUNT In-Reply-To: <5.0.0.25.2.20001019140625.049308b0@pop.mindspring.com> References: <20000906202707.A4767@s2.enthdimension.com.au> <5.0.0.25.2.20001019140625.049308b0@pop.mindspring.com> X-Mailer: VM 6.72 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-Archive-Number: 200010/182 X-Sequence-Number: 1844 >>>>> "Brian" == Brian C Doyle writes: Brian> Hello, You will need to do "SELECT count(attribute) FROM Brian> table;" or SELECT count(table.attribute);" You need to watch this: acspg=# create table tst ( acspg(# a integer acspg(# ); CREATE acspg=# insert into tst values (0); INSERT 333481 1 acspg=# insert into tst values (null); INSERT 333482 1 acspg=# insert into tst values (2); INSERT 333483 1 acspg=# select count(*) from tst; count ------- 3 (1 row) acspg=# select count(a) from tst; count ------- 2 (1 row) acspg=# select count(1) from tst; count ------- 3 (1 row) acspg=# If you use the attribut name, null values won't be counted. -Dan