View Single Post
  #5 (permalink)  
Old Mar 18th, 2006, 09:25
grahame grahame is offline
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Counting Instances in a table.

Slight increase in speed perhaps ... but the reason I do it by a particular field in other is that it gives you the flexibility to count only rows which actually have a value in the column specified. If you count a column declared as NOT NULL you get everything, of course.

Example of the extra flexibility

select agent, count(price), from hfs group by agent;

will count up the number of properties for which a price is advertised, by agent. Probably not relevant though, if you're not going to want thie extra flexibility later.

-- Graham
Reply With Quote