Re: Odd Results on Mysql LIMIT and ORDER BY

2008-04-26 Thread Brent Baisley
You may want to check on the version you are running. There have been a few odd bugs in various MySQL versions in regards to limits and order by filtering. Although it usually involved joins and/or unions. If you can't or don't want to upgrade your MySQL version, you can try restructuring y

Odd Results on Mysql LIMIT and ORDER BY

2008-04-26 Thread j's mysql general
Hi Guys, Firstly, this is the only time I have ever encountered this problem and searching archives or google shed no luck since yesterday so here I am . I have a table described below: mysql> describe containers; +++--+-+-+

Re: mySQL LIMIT and ORDER BY Problem???

2004-07-04 Thread John Hicks
On Sunday 04 July 2004 02:52 am, Gary Mack wrote: > Hi there, > > I recently learned about LIMIT so that I can page > through records on a web page I am creating. > However, when coupled with ORDER BY, the sorting > does not work anymore. Can someone look at my below > query and point out what I

mySQL LIMIT and ORDER BY Problem???

2004-07-04 Thread Gary Mack
Hi there, I recently learned about LIMIT so that I can page through records on a web page I am creating. However, when coupled with ORDER BY, the sorting does not work anymore. Can someone look at my below query and point out what I am doing wrong? Thanks. This is my first time posting to

RE: Limit and Order by

2002-12-05 Thread John Coder
On Thu, 2002-12-05 at 19:39, Michelle de Beer wrote: > > you mean mySQL does the search on 100 first entries > > and then order the > > results, instead of getting the results and > > returning only the first 100 ? > > If yes I too would like to know what's the right way > > to do it in SQL then ?

Re: Limit and Order by

2002-12-05 Thread Jeff Kilbride
older versions of MySQL had a bug with order by and limit clauses, though... --jeff - Original Message - From: "Michelle de Beer" <[EMAIL PROTECTED]> To: "Alliax" <[EMAIL PROTECTED]>; "mysql list" <[EMAIL PROTECTED]> Sent: Thursday, Dece

Re: Re: Limit and Order by

2002-12-05 Thread Michael T. Babcock
On Thu, Dec 05, 2002 at 02:00:43PM -0800, Michelle de Beer wrote: > Select * from mytable ORDER by total desc limit 0, 100 See my other most recent reply; you can do it in two queries: CREATE TEMPORARY TABLE Top100 SELECT * ... limit 0,100; SELECT * FROM Top100 ORDER BY ...; The temporary table

Re: Limit and Order by

2002-12-05 Thread Steve Edberg
At 2:00 PM -0800 12/5/02, Michelle de Beer wrote: How can I limit the result after the "order by" has been executed? This stops efter 100 rows and the result is not as I intended... Select * from mytable ORDER by total desc limit 0, 100 Must this be done in PHP? Perhaps you could tell us wha

RE: Limit and Order by

2002-12-05 Thread Michelle de Beer
> you mean mySQL does the search on 100 first entries > and then order the > results, instead of getting the results and > returning only the first 100 ? > If yes I too would like to know what's the right way > to do it in SQL then ? That is correct. This is what I have: One table with 1000 recor

Limit and Order by

2002-12-05 Thread Alliax
I am not sure I understand your question, I thought the line you showed would give proper results (100 total-ordered lines) but maybe : So there is a similar thread running now, Re: SQL Select Idea [ORDER BY] by Michael, he says creating a temporary table is the way to go : "create temporary tabl

RE: Limit and order by

2002-12-05 Thread John Coder
MYSQL On Thu, 2002-12-05 at 17:00, Michelle de Beer wrote: > How can I limit the result after the "order by" has > been executed? This stops efter 100 rows and the > result is not as I intended... > > Select * from mytable ORDER by total desc limit 0, 100 > > Must this be done in PHP? > > Thanks

Limit and Order by

2002-12-05 Thread Michelle de Beer
How can I limit the result after the "order by" has been executed? This stops efter 100 rows and the result is not as I intended... Select * from mytable ORDER by total desc limit 0, 100 Must this be done in PHP? Thanks for all replys to my topics, btw. Any thoughts? // Michelle sql, query ___

RE: limit and order by issuse

2001-09-06 Thread [EMAIL PROTECTED]
issue is solved. check change log here: http://phpmyadmin.sourceforge.net/ChangeLog.txt regards, shahzad -Original Message- From: Henning Schroeder [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 05, 2001 3:23 PM To: [EMAIL PROTECTED] Subject: RE: limit and order by issuse >

Re: limit and order by issuse

2001-09-05 Thread Fournier Jocelyn [Presence-PC]
This is fixed in PhpMyAdmin 2.2.0 - Original Message - From: "Henning Schroeder" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 06, 2001 12:23 AM Subject: RE: limit and order by issuse > > >sh> Here is my query: > >

RE: limit and order by issuse

2001-09-05 Thread Henning Schroeder
>sh> Here is my query: > >sh> SELECT >sh> articleId,arttitle,artsourceId,artstatus,artauthorId,arteventdate,artpre >sh> ss,artpageno,artrankId,artabstract, >sh> artfulltext,artisdisplay,arteditionId,arttypeid,artsubjectid , >sh> asubjectId,asubjectname , FLOOR((TO_DAYS(CURRENT_DATE()) - >sh> TO_D

RE: limit and order by issuse

2001-09-05 Thread Michael Widenius
Hi! > "sh" == shahzazd@shebaak com <[EMAIL PROTECTED]> writes: sh> Thanks for quick response. sh> Here is my query: sh> SELECT sh> articleId,arttitle,artsourceId,artstatus,artauthorId,arteventdate,artpre sh> ss,artpageno,artrankId,artabstract, sh> artfulltext,artisdisplay,arteditionId,artt

RE: limit and order by issuse

2001-09-04 Thread Philip Mak
I see... if adding "ORDER BY articleId DESC LIMIT 0, 20" causes a query to start returning 0 rows, then that sounds like something is wrong. Try using the REPAIR TABLE command on all your tables from inside MySQL, e.g.: REPAIR TABLE article; REPAIR TABLE asubject; REPAIR TABLE atype; REPAIR TABL

RE: limit and order by issuse (fwd)

2001-09-04 Thread Philip Mak
[table sql stupid spam filter] On Tue, 4 Sep 2001, [EMAIL PROTECTED] wrote: > order by articleId desc limit 1 , 20 That will cause no rows to be returned if there are less than 20 results. Use this instead: ORDER BY articleId DESC LIMIT 0, 20 It starts counting at 0 instead of 1. -

RE: limit and order by issuse

2001-09-04 Thread [EMAIL PROTECTED]
al Message- From: Philip Mak [mailto:[EMAIL PROTECTED]] On Behalf Of Philip Mak Sent: Tuesday, September 04, 2001 3:25 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: limit and order by issuse On Tue, 4 Sep 2001 [EMAIL PROTECTED] wrote: > I am trying to use limit and order by in the s

Re: limit and order by issuse

2001-09-04 Thread Philip Mak
On Tue, 4 Sep 2001 [EMAIL PROTECTED] wrote: > I am trying to use limit and order by in the same query for paging of > records. But faceing the problem that query does not return any row. > After removing of limit every thing is working fine. > > Is it really a bug. Any solution.

limit and order by issuselimit and order by issuse

2001-09-04 Thread shahzad
hello, I am trying to use limit and order by in the same query for paging of records. But faceing the problem that query does not return any row. After removing of limit every thing is working fine. Is it really a bug. Any solution. mysql version 3.23.38 regards, shahzad