Sum of values for each row
To answer this, I did the following.

mysql&gt; CREATE TABLE myid(id INT, myname VARCHAR(10));
Query OK, 0 rows affected (0.35 sec)

mysql&gt; INSERT INTO myid VALUES (1, 'Paul');
Query OK, 1 row affected (0.06 sec)
mysql&gt; INSERT INTO myid VALUES (2, 'Peter');
Query OK, 1 row affected (0.07 sec)

mysql&gt; CREATE TABLE myrating(ratename VARCHAR(10), therating INT);
Query OK, 0 rows affected (0.43 sec)

mysql&gt; INSERT INTO myrating VALUES('Paul', 3);
Query OK, 1 row affected (0.05 sec)
mysql&gt; INSERT INTO myrating VALUES('Paul', 4);
Query OK, 1 row affected (0.04 sec)
mysql&gt; INSERT INTO myrating VALUES('Peter', 6);
Query OK, 1 row affected (0.06 sec)
mysql&gt; INSERT INTO myrating VALUES('Peter', 456);
Query OK, 1 row affected (0.06 sec)


And then performed the query

SELECT myid.myname, SUM(myrating.therating) AS The_Rating 
FROM myid inner 
JOIN myrating 
ON myrating.ratename = myid.myname 
GROUP BY myid.myname;


Obtaining the result:

+--------+------------+
| myname | The_Rating |
+--------+------------+
| Paul   |          7 |
| Peter  |        462 |
+--------+------------+
2 rows in set (0.04 sec)


Does this satisfy your requirements?