Peter South wrote:
Ok here is what I'm trying to do.

         Table 1                                          Table 2               
                               Table 3
Column1(id) Column2 (score) Column1(id) Column2(score) Column1(id) Column2(name) 1 10 1 15 1 Fred 2 10 2 (no score) 2 Jim 3 (no score) 3 15 3 Joe



The result I want is Fred scored 25 (or) Joe scored 15 (or)
Jim scored 10.
Peter

Like the others said, join your tables and add them up:

select t1.id as id, sum(t1.score + t2.score + t3.score) as total from table1 t1, table2 t2, table3 t3 where t1.id=t2.id and t1.id=t3.id group by t1.id;


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to