List:General Discussion« Previous MessageNext Message »
From:Steve Edberg Date:December 5 2002 11:43pm
Subject:Re: Limit and Order by
View as plain text  
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 what you DO intend? Because the statement 
above does indeed limit the results to the highest 100 totals - the 
limit is done after the order by.

-steve

Sql! Query!

-- 
+------------------------------------------------------------------------+
| Steve Edberg                                      sbedberg@stripped |
| University of California, Davis                          (530)754-9127 |
| Programming/Database/SysAdmin               http://pgfsun.ucdavis.edu/ |
+------------------------------------------------------------------------+
| SETI@Home: 1001 Work units on 23 oct 2002                              |
| 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens...  |
+------------------------------------------------------------------------+
Thread
Limit and Order byMichelle de Beer5 Dec
Re: Limit and Order bySteve Edberg6 Dec
RE: Limit and order byJohn Coder6 Dec