This trick is easy, but syntax differs from SQL engine to engine.
For MySQL it is:
select * from table limit [offset,] row_count
Or : select * from employee limit 10 for page 1 select * from employee limit 10, 10 for page 2 select * from employee limit 20, 10 for page 3 etc.
For others:
You have to select the limit <rows_per_page> not in the limit ((current_page - 1) * rows_per_page)
E.g. for SQL Server
select top 10 * from tablea where tablea.pk not in (select top 10 pk from tablea)
for page 2 etc.
Note you have to put the exact same where clauses in both selects if you need them.
One can see what makes MySQL popular as a web backend.
Ed
Robert Citek wrote:
On Thursday, Feb 17, 2005, at 12:45 US/Central, Rex Nelson wrote:
Yes, if you "try" to open a table that big it will cause problems, but the way around that is to use the "custom query" tab and get mysql to give you just the items you want to see. If you need to browse that is a problem though.
OK. Good to know that that's the work-around. In MySQL, limit 10 will give you the first 10 rows. Is there a way to specify the next 10 or say rows 100-200 or rows 10,20,30,40 ?
Regards, - Robert http://www.cwelug.org/downloads Help others get OpenSource software. Distribute FLOSS for Windows, Linux, *BSD, and MacOS X with BitTorrent
_______________________________________________ CWE-LUG mailing list http://www.cwelug.org/ [email protected] http://lists.firepipe.net/listinfo/cwe-lug
-- Ed Howland WDT Solutions, LLC. [EMAIL PROTECTED] (314) 962-0766
_______________________________________________
CWE-LUG mailing list
http://www.cwelug.org/ [email protected]
http://lists.firepipe.net/listinfo/cwe-lug
