2 Replies Latest reply on Feb 18, 2007 6:15 PM by azadisaryev

    Recordset results

    Level 7
      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


        • 1. Re: Recordset results
          Level 7
          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
          >
          >
          • 2. Re: Recordset results
            azadisaryev Level 1
            > 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.