Hi Pete,

When you run this: select score from exams limit 20,10

your are not creating a found set of the records from 20-29, but  
rather finding all the records and limiting what is viewed. You need  
a either a WHERE to limit the found set in the results or take this  
record set and insert it into a temp table then you can:

select sum(score) from temp_exams

Lastly when your done you can either drop the table or just empty it.

Sincerely,
Mike
-- 
Mike Brandonisio          *    Web Hosting
Tech One Illustration     *    Internet Marketing
tel (630) 759-9283        *    e-Commerce
[EMAIL PROTECTED]    *    http://www.jikometrix.net

     JIKOmetrix - Reliable web hosting


On Aug 2, 2006, at 8:19 AM, agneady wrote:

> Let's say I have a query like this one:
>
> select score from exams limit 20,10
>
> So, it returns the scores for records 20-29 from the exams table. Now,
> I want the sum of these returned scores. If I use:
>
> select sum(score) from exams
>
> it returns the sum of all scores. What I want is the sum of scores x
> to y only. Can this be done with a MySQL query? I know I can do it in
> PHP easily, but I want to do it through a query if possible.
>
>
>
>
>
>
> The php_mysql group is dedicated to learn more about the PHP/MySQL  
> web database possibilities through group learning.
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>



The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to