You should use <cfquery maxrows="n"> to get the top n records.
The keyword TOP is actually proprietary (MSSQL only). Joel Cass Developer Gruden - Design | Development | Implementation t +61 2 9299 9462 f +61 2 9299 9463 m 0414 688 774 www.gruden.com -----Original Message----- From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Joris de Beer Sent: Friday, 7 March 2008 1:01 PM To: cfaussie@googlegroups.com Subject: [cfaussie] Re: Query of query and TOP Sounds like the right way to do it. On 07/03/2008, at 10:16 AM, Scott Thornton wrote: > > Hi, > > Just wondering if there was an equivalent of top n that could be > used in a query-of-query. > > When I used top 10, i received an error, so I used the maxrows > attribute instead to restrict the values. just wondering if I have > done the correct thing > > eg > > <CFQUERY datasource="testdatasource_local" name="TEST"> > SELECT > TOP 1000 > * > FROM > test_table > </CFQUERY> > > > <cfquery name="test2" dbtype="QUERY" maxrows="10"> > select > * > from > TEST > </cfquery> > > Thanks, > > Scott Thornton, Programmer > Billing Unit > Hunter-New England Area Health Service > ext: 24505 p: +61 02 4941 4505 m: 0413 800 242 > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~----------~----~----~----~------~----~------~--~---