[thelist] SQL: using GROUP BY and COUNT

rudy r937 at interlog.com
Tue Aug 20 00:33:01 CDT 2002


>We can write a FOR loop to write out all the phone numbers:

all i can say is, asp sure is ugly

in coldfusion, after the query has run, let's say it was called
contactquery, here's how to output all the phone numbers

  <cfoutput query=contactquery>
       #cPhone# <br />
  </cfoutput>

no getrows, no arrays, no explicit loops, no indexes, no upper bounds...

just a neat stack of phone numbers

don't want 'em stacked?  don't use a <br />, use a comma or something

the important point is, it's a lot more obvious how the output is
integrated with the html it is part of, without a lot of superfluous code
getting in the way of comprehension

rudy




More information about the thelist mailing list