From: Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>
To: Pgsql-sql@postgresql.org <Pgsql-sql@postgresql.org>
Subject: How to get a count() where column < ''?
Date: Sun, 04 Dec 2005 22:12:52 +0100
Message-ID: <1133730772.5560.8.camel@Panoramix> (raw)
Hi,
I want the number of customers that have a zipCode smaller tha a given
value. The foolowing query doe snot work : I get an error (ERROR:
column "addresses.zipcode" must appear in the GROUP BY clause or be used
in an aggregate function) and I do not know how to solve it.
SELECT COUNT(customers.objectid) FROM prototype.customers,
prototype.addresses
WHERE
customers.contactaddress = addresses.objectid
AND
zipCode < '2716BN'
ORDER By zipCode, houseNumber
Anyone an idea?
TIA
--
Groeten,
Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl
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: J.Kraaijeveld@Askesis.nl
Subject: Re: How to get a count() where column < ''?
In-Reply-To: <1133730772.5560.8.camel@Panoramix>
* 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