adding a column

Codes here !

Moderators: egami, macek, gesf

Post Reply

Thu Feb 06, 2003 10:58 pm

ok, say i had a db which had a playerID field and a score field. say the playerID isnt a primary key and there is multiple instances of it. if i did "SELECT score FROM table WHERE playerID=4" it might return multiple results. how would i get a total of score instead of multiple results? i hope that made sense :P

User avatar
Posts: 826
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Fri Feb 07, 2003 2:53 am

SELECT sum(score) FROM table WHERE playerID=4


Sun Feb 09, 2003 2:57 pm

thanks a ton :D thats perfect

Post Reply