List:General Discussion« Previous MessageNext Message »
From:Steve Edberg Date:February 17 2000 9:22am
Subject:Re: Limit and the rest....
View as plain text  
At 4:23 PM +0800 2/17/00, Mark Lo wrote:
>Hi,
>
>I know I can use LIMIT FUNCTION to limit the result sets.
>
>eg....SELECT * from table limit 10;
>
>But I would like to show the total number of records such as
>|10|20|30|40|50|60|...until the end.....and When the user click the
>field "|20|", then I can able to show the results from 10 to 20...and so
>on....Anyone got any ideas of how to do it.
>

One additional query:

	SELECT COUNT(*) FROM table

Then, the 'page' queries would be

	SELECT * FROM table LIMIT 0,10
	SELECT * FROM table LIMIT 10,10
	SELECT * FROM table LIMIT 20,10
	...

and so on, until you reach the record count or your maximum # of pages limit.

- steve

+---------------- Splurk! Glort! Klikrunk! Ploip! Katoong!---------------+
| Steve Edberg                           University of California, Davis |
| sbedberg@stripped                                     (530)754-9127 |
| Computer Consultant                         http://aesric.ucdavis.edu/ |
+------------------ Don Martin 18 May 1931 - 7 Jan 2000 -----------------+
Thread
Limit and the rest....Mark Lo17 Feb
  • Re: Limit and the rest....Steve Edberg17 Feb
  • Re: Limit and the rest....Thimble Smith17 Feb