How to get a count() where column < ''? - Mailing list pgsql-sql

From Joost Kraaijeveld
Subject How to get a count() where column < ''?
Date
Msg-id 1133730772.5560.8.camel@Panoramix
Whole thread Raw
Responses Re: How to get a count() where column < ''?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-sql
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 




pgsql-sql by date:

Previous
From: Theodore Petrosky
Date:
Subject: Re: question using 'between' in a sql query
Next
From: Stephan Szabo
Date:
Subject: Re: How to get a count() where column < ''?