I don't know if you are in the wrong forum. As ColdFusion developers we
are well accustomed to mixing many technologies, SQL, HTML, JavaScript,
AJAX, and more.

I was just trying to point out in which one you where dealing with as
that often helps.

I.E. If you Googled for this problem confined to CF you would get a much
smaller set of results then if you identified it as SQL where you might
find discussions on doing this kind of group counting from an Oracle or
MS SQL or Mysql or just general ansii 92 SQL resource.