List:General Discussion« Previous MessageNext Message »
From:Eduardo Arino de la Rubia Date:April 18 1999 3:52pm
Subject:Re: syntax
View as plain text  
select foo from table where condition limit 0, 20;
select foo from table where condition limit 20, 20;
select foo from table where condition limit 40, 20;
select foo from table where condition limit 60, 20;

etc.. etc.. etc.. the limit keyword will do exacly what you want.

-------------------------------------------------------------------------------
1 + 1 = 3, for large values of 1. |     ed@stripped    | arino@stripped
-------------------------------------------------------------------------------

On Sun, 18 Apr 1999, Paul Sullivan wrote:

> Heres what I'm running:
> 
> mysql-3.21.19-21.
> Database with one table containing 2000+ entries.
> 
> 
> What I need to do:
> 
> On a selection with search criteria for two matching column items (i.e.
> CATEGORY and ID), I would like to return, a certain range of matching
> items.  So for example, I run a select statement for those two matching
> columns, and it returns 515 matching column items.  Now out of the returned
> 515, I only want the db client to return matchs 1 through 20 or 21 through
> 40, and so on. I know i could easily accomplish this script side (using
> perl + mod DBI) with some limited sorting, but that eats up alot of memory
> to narrow down 515 to a specific range.  I was hoping that there were some
> available function or call that would work.
> 
> Any suggestions anyone may have, are appreciated.
> 
> 
> Thanks for your time.
> 
> (A)bort, (R)etry, (T)hink (D)ifferent
> 
> --------------
> Paul Sullivan           P. 305.377.2880
> System Administrator    F. 305.377.2870
> Plexus InterACTIVE      E. psullivan@stripped
> http://www.plexmedia.com/
> --------------
> 
> 
> 
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread2025@stripped
> 
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail mysql-unsubscribe@stripped instead.
> 

Thread
syntaxPaul Sullivan18 Apr
  • Re: syntaxEduardo Arino de la Rubia18 Apr