Forum Moderators: coopster

Message Too Old, No Replies

question about how MYSQL works

         

WSQuant

12:59 pm on Jun 30, 2005 (gmt 0)

10+ Year Member



I am just trying to get a feel for how MySQL works for GROUP BY functions

if i have a simple query like:

SELECT item1, SUM(item2)
FROM myTable
GROUP BY item1

and there say 100 line items in the table. and 50 versions of item1 (item1a, item1b, etc...), so the query would return 50 lines with item1 and the sum of two numbers in item2.

To do this does MySQL have to go through the whole table to find all item1a's to sum, then go through the whole table to find all item1b's to sum and so forth?

If not can someone explain to me how MySQL works for group by functions.

Thanks

WSQuant

3:15 pm on Jun 30, 2005 (gmt 0)

10+ Year Member



No one has an answer?

Sarah Atkinson

3:39 pm on Jun 30, 2005 (gmt 0)

10+ Year Member



Sorry but I've never used GROUP BY

jatar_k

4:30 pm on Jun 30, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



there are many around that have a better intrinsic knowledge of mysql, I just look through the manual

[dev.mysql.com...]