Forum Moderators: open

Message Too Old, No Replies

subtract from sum

calculate the sum of points from on col and then subtract a value

         

phparion

7:25 pm on Mar 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



i have a user table in which one col is named as POINTS.

it contains the points of user gained from different events.

now i want to subtract a specific value from the total points that i get using SUM(point) mysql function.

i have written a query that is wrong but it will give you the idea what i am looking to do.

say i want to subtract 100 points from user then i am using query like


update users set SUM(points - 100)

please guide me how can i do this. thanks