PDA

View Full Version : adding field from all rows together


N!ck
03-20-2002, 04:12 AM
how do i add a certain field together for all columns? for instance, on 'user' i have a field called 'donations' which stores how much money a user has donated. how do i add all users' donations together?

Admin
03-20-2002, 04:37 AM
Here's the query:
SELECT SUM(donations) AS total FROM user;

N!ck
03-20-2002, 03:17 PM
thanks