[thelist] SQL: using GROUP BY and COUNT
Chris W. Parker
cparker at swatgear.com
Tue Aug 20 11:25:01 CDT 2002
> -----Original Message-----
> From: Ken Kogler [mailto:ken.kogler at curf.edu]
> Sent: Monday, August 19, 2002 10:10 PM
> To: thelist at lists.evolt.org
> Subject: RE: [thelist] SQL: using GROUP BY and COUNT
>
>
> > > what i was talking about was the
> > > value of having a piece of code that
> > > says
> > >
> > > <td>#temperature#</td>
> > >
> > > rather than
> > >
> > > <td>#expression3#</td>
> > >
> > > or even your implied
> > >
> > > <td>#queryresult[3]#</td>
>
> > ahhh... right. afaik asp doesn't work like that.
>
> But it can! Assume getRows() returns a bunch or rows from a 4-column
> table of contact info. The table is laid out like this:
...
> We can write a FOR loop to write out all the phone numbers:
>
> for rowLoop = 0 to ubound(arrContact,2)
> response.write arrContact(2,rowLoop)
> next
>
> But if we look at that code a year from now, we won't have
> any clue what
> "arrContact(2,rowLoop)" is supposed to be without digging back through
> the code to look it up, which (depending on your code!) can be a real
> pain. Consider this then:
>
> const cPhone = 2
> for rowLoop = 0 to ubound(arrContact,2)
> response.write arrContact(cPhone,rowLoop)
> next
>
> Catch that?
yes. i understand. and that's not a bad idea.
chris.
More information about the thelist
mailing list