Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Query Rows

Participant ,
Aug 13, 2008 Aug 13, 2008
I need to query a table of 96 rows As WhatEver in groups of 4 and then I imagine cfloop the output. I already have everything written to handle the As part for math functions. What would be the best way to query the rows in groups of 4?
TOPICS
Getting started
552
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 13, 2008 Aug 13, 2008
Query all 96 rows.

loop through the results 4 rows at a time and do what you have to do.
Translate
LEGEND ,
Aug 13, 2008 Aug 13, 2008
Query all 96 rows.

loop through the results 4 rows at a time and do what you have to do.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 13, 2008 Aug 13, 2008
Once again... Thanks Dan!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 13, 2008 Aug 13, 2008
I must be missing something in the cf book. How do I get a loop of a query to repeat after it's gone through the first 4 rows? Other than than that it worked great.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 13, 2008 Aug 13, 2008
LATEST
Inkfast wrote:
> I must be missing something in the cf book. How do I get a loop of a query to repeat after it's gone through the first 4 rows? Other than than that it worked great.

<cfset start="16">

<cfoutput query="my96Rows" startRow="#start#" maxRows="4">
#my96Rows.aColumn#
</cfoutput>

See if this doesn't give you some ideas?

Another fun exercise:

<cfloop from="1" to="96" step="4" index="r">
#my96Rows["aColumn"]
#my96Rows["aColumn"][r+1]
#my96Rows["aColumn"][r+2]
#my96Rows["aColumn"][r+3]
<hr/>
</cfloop>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources