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

From Jim Johannsen
Subject Re: How to get a count() where column < ''?
Date
Msg-id 43936B04.3010006@gvtc.com
Whole thread Raw
In response to Re: How to get a count() where column < ''?  (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>)
List pgsql-sql
Joost Kraaijeveld wrote:

>Hi Stephan,
>
>On Sun, 2005-12-04 at 13:33 -0800, Stephan Szabo wrote:
>  
>
>>>SELECT COUNT(customers.objectid) FROM prototype.customers,
>>>prototype.addresses
>>>WHERE
>>>customers.contactaddress = addresses.objectid
>>>AND
>>>zipCode < '2716BN'
>>>ORDER By zipCode, houseNumber
>>>      
>>>
>
>  
>
>>In a non-grouped query like the above, I don't think that the order by is
>>meaningful.  You only get one row back anyway without a group by, and
>>there's no single zipCode or houseNumber to associate with the row.
>>
>>    
>>
>What do you mean by a non-grouped query? The query below gives the same
>error:
>
>SELECT zipcode, COUNT(*) FROM prototype.customers, prototype.addresses 
>WHERE 
>customers.contactaddress = addresses.objectid 
>AND 
>zipCode < '2716BN' 
>
>  
>
Try   SELECT COUNT(*)   FROM prototype.customers, prototype.addresses   WHERE customers.contactaddress =
addresses.objectid       AND zipCode < '2716BN'
 




pgsql-sql by date:

Previous
From: Joost Kraaijeveld
Date:
Subject: Re: How to get a count() where column < ''?
Next
From: Joost Kraaijeveld
Date:
Subject: Re: How to get a count() where column < ''?