Re: Count(*) with additional query
Posted in 2000
mrs_staceysmith@my-deja.com wrote:
>I would like to count rows when I do a select
>statement for specific columns, but count(*) does
>not like that:
>
>select count(*),
> propertyname,
> objectid
>from properties
>where propertyname='SITENAME'
Maybe I'm not understanding your question, but it looks like all you need is to add the following line:
group by 2,3
This will give you a count of every unique combination of propertyname/objectid for the criteria in your where clause. If that's not what you're looking for, perhaps you could give us a clear presentation of what it is you're trying to accomplish and a suggestion could be made that does what you want.
>I would prefer not to, but do I have to put these
>into separate select statements?
>
>select count(*)
>from properties
>where propertyname='SITENAME'>
>select propertyname,
> objectid
>from properties
>where propertyname='SITENAME'>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
carlos
Currently on hiatus from unemployment.
----------------------
Do you do Linux? :)
Get your FREE @linuxstart.com email address at: http://www.linuxstart.com