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

Recordset results

LEGEND ,
Feb 17, 2007 Feb 17, 2007

Copy link to clipboard

Copied

I have a page that displays the first 3 records bigger than the balance and
I limited my SQL by adding a LIMIT 3 on the end. I want to also query the
database and have the balance (all record except the first 3) show elsewhere
on the page.

Can you create a SQL statement that does not show the first 3 records?

--
Wally Kolcz
MyNextPet.org
Founder / Developer
586.871.4126


TOPICS
Advanced techniques

Views

280

Translate

Translate

Report

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 ,
Feb 18, 2007 Feb 18, 2007

Copy link to clipboard

Copied

Will this work?

<cfoutput query="rsTest" startrow="4">

--
Ken Ford
Adobe Community Expert
Fordwebs, LLC
http://www.fordwebs.com


"WebDev" <wkolcz@softproofs.com> wrote in message news:er830e$799$1@forums.macromedia.com...
>I have a page that displays the first 3 records bigger than the balance and
> I limited my SQL by adding a LIMIT 3 on the end. I want to also query the
> database and have the balance (all record except the first 3) show elsewhere
> on the page.
>
> Can you create a SQL statement that does not show the first 3 records?
>
> --
> Wally Kolcz
> MyNextPet.org
> Founder / Developer
> 586.871.4126
>
>

Votes

Translate

Translate

Report

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
Engaged ,
Feb 18, 2007 Feb 18, 2007

Copy link to clipboard

Copied

LATEST
> I want to also query the database and have the balance (all record except the
> first 3) show elsewhere on the page.

do you mean you want to
a) show all records with balance > some number (not just first 3)
b) or that you want to show ALL records no matter what the balance is?

if a), then drop the LIMIT=3 from your query and use startrow=1 maxrows=3 in the cfoutput instead (assuming your query sorts the results by balance in DESC order); in the cfoutput for all other records use startrow=4 as Ken suggested.

however, if b), then <cfoutput query="rsTest" startrow="4"> will not work, since your query is pulling only records with balance > some number. in this case you will need to use a query of queries (QoQ) to achieve what you want.
make your first query pull ALL records from the db.
make a QoQ to select only 3 records with balance > some number from the first query's results.
make another QoQ to select all records from your original query except those pulled by the first QoQ.

Votes

Translate

Translate

Report

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
Documentation