Dear Friends,
 
I have two tables: T1, T2.
 
T1 has 3 columns: playerid, gameid, score
T2 has 2 columns: playerid, totalscore.
 
I wish to update table T2 such that sum of T1.score of each player, gets
updated in T2.totalscore. It may be something like this:
 
update T2, T1 set T2.totalscore = sum(T1.score) where T1.playerid =
T2.playerid 
 
OR
 
update T2, T1 set T2.totalscore = sum(T1.score) where T1.playerid =
T2.playerid group by playerid
 
However none of the above is working.
 
Where am I wrong? Please help.
 
The version of MySQL I am using is 4.1.14-standard-log.
 
Thanks,
 
Ravi.
 

Reply via email to