In the last episode (Apr 04), Mat Murdock said:
>    If I understand the manual correctly when I do a  "select blah
>    from blah where blah = blah order by blah limit 10" Mysql finds
>    the first 10 matching records and then sorts those records.  How
>    do I have it first sort the database and then take the first 10
>    records?

It does that already.  In general, you can think of each SQL phrase
being applied to the resultset in order.  WHERE gets run, then GROUP
BY, then ORDER BY, then HAVING, then LIMIT (which explains why you
can't put a count() clause in WHERE, because the database doesn't even
know the count until the GROUP BY stage).

-- 
        Dan Nelson
        [EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to