not sure what DB you're using.. but with Oracle you can do this in a subquery select * from ( select rownum as rn, n.* >From navmenu n ) where rn >= 5 and rn <= 7
On 1/5/07, Dave Phillips <[EMAIL PROTECTED]> wrote: > Does anyone know if it's possible to extract a 'subset' of records in a query > utilizing Query of Queries? Basically I want to do something like this: > > <cfquery name="qMyQuery" dbtype="query"> > SELECT * > FROM qSomeQuery > WHERE currentRow >= 21 AND currentRow < 41 > ORDERY BY LastName > </cfquery> > > Of course, this doesn't work because currentrow does not specify the row > number inside of a Query, only when you are working with the query results > directly (like qSomeQuery.currentRow). > > Anyone know how this is possible? The only thing I can think of doing is > something like this: > > <cfoutput name="qSomeQuery" startRow="21" maxrows="40"> > *** In here I would build a new query with only the rows available as I > loop through with functions like queryAddRow() and querySetCell(). > </cfoutput> > > This idea would not be very efficient, so I'm looking for an alternative > method. > > Thanks for your help in advance! > > Dave > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265817 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4