This content has been marked as final. Show 2 replies
Will this work?
<cfoutput query="rsTest" startrow="4">
Adobe Community Expert
"WebDev" <firstname.lastname@example.org> wrote in message news:email@example.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
> Founder / Developer
> 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.