> <cfoutput query="query" STARTROW="#iStart#" > MAXROWS="#iMessagesPerPage#">
Does this not actually perform the query "unrestricted" and then CF does the limiting? So that method's not so good if you've got a query qhich would return 1,000,000 rows and you only want to see 10 of them... I like the MySQL LIMIT clause - you specify the number of rows to retrieve and the offset to start the retrieve from which puts the work onto the DB server not the CF server and also means you're not pushing 1,000,000 rows of data across the network etc: >From http://www.mysql.com/doc/en/SELECT.html : ------------------------------8<-------------------------- The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments, which must be integer constants. With one argument, the value specifies the number of rows to return from the beginning of the result set. With two arguments, the first specifies the offset of the first row to return, the second specifies the maximum number of rows to return. The offset of the initial row is 0 (not 1): To be compatible with PostgreSQL MySQL also supports the syntax: LIMIT row_count OFFSET offset. mysql> SELECT * FROM table LIMIT 5,10; # Retrieve rows 6-15 To retrieve all rows from a certain offset up to the end of the result set, you can use -1 for the second parameter: mysql> SELECT * FROM table LIMIT 95,-1; # Retrieve rows 96-last. If one argument is given, it indicates the maximum number of rows to return: mysql> SELECT * FROM table LIMIT 5; # Retrieve first 5 rows In other words, LIMIT n is equivalent to LIMIT 0,n. ------------------------------8<-------------------------- Tim. ------------------------------------------------------- RAWNET LTD - Internet, New Media and ebusiness Gurus. Visit our new website at http://www.rawnet.com for more information about our company, or call us free anytime on 0800 294 24 24. ------------------------------------------------------- Tim Blair Web Application Engineer, Rawnet Limited Direct Phone : +44 (0) 1344 393 441 Switchboard : +44 (0) 1344 393 040 ------------------------------------------------------- This message may contain information which is legally privileged and/or confidential. If you are not the intended recipient, you are hereby notified that any unauthorised disclosure, copying, distribution or use of this information is strictly prohibited. Such notification notwithstanding, any comments, opinions, information or conclusions expressed in this message are those of the originator, not of rawnet limited, unless otherwise explicitly and independently indicated by an authorised representative of rawnet limited. ------------------------------------------------------- -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
