| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Christian Mack | Date: | August 11 1999 6:31pm |
| Subject: | Re: Use (problem with?) LIMIT in select statement | ||
| View as plain text | |||
tonu-mysql@stripped wrote: > > On Wed, 11 Aug 1999, Paul McAvoy wrote: > > > Hi, I am currently using Mysql 3.22.25-1 (RPM). I think that I may have found > > a bug, or it may be that I am unclear on how the select statement works. > > > > My Query is similar to this: > > > > SELECT id,name FROM list ORDER BY name LIMIT 20; > > > > I was under the impression that teh LIMIT clause was used to limit the > > return set. > > Yes, it must work like you understood. It must order all items in your > table and THEN take the first 20 records and give them back. If it does > something different, then it's wrong. > > Tonu Hi Mysql doesn't do this. As described in the manual mysql will stop getting results, when it reached the given amount. It will only satisfy the WHERE part of your query. The ordering is done after getting the results. So you get with the above SELECT 20 rows which are ordered, not the first 20 from the ordered list. Tschau Christian
| Thread | ||
|---|---|---|
| • Use (problem with?) LIMIT in select statement | Paul McAvoy | 11 Aug |
| • Re: Use (problem with?) LIMIT in select statement | tonu-mysql | 11 Aug |
| • Re: Use (problem with?) LIMIT in select statement | Christian Mack | 11 Aug |
| • Re: Use (problem with?) LIMIT in select statement | tonu-mysql | 11 Aug |
| • Re: Use (problem with?) LIMIT in select statement | Steve Edberg | 11 Aug |
| • Re: Use (problem with?) LIMIT in select statement | Tonu Samuel | 11 Aug |
| • Re: Use (problem with?) LIMIT in select statement | Steve Ruby | 11 Aug |
| • Re: Use (problem with?) LIMIT in select statement | Thimble Smith | 11 Aug |
| • Re: Use (problem with?) LIMIT in select statement | Paul McAvoy | 11 Aug |
| • Re: Use (problem with?) LIMIT in select statement | Paul McAvoy | 11 Aug |
| • Re: Use (problem with?) LIMIT in select statement | Paul DuBois | 11 Aug |
| • Re: Use (problem with?) LIMIT in select statement | Christian Mack | 12 Aug |
| • RE: Use (problem with?) LIMIT in select statement | Clinton | 11 Aug |
