one mysql db, one mysql table, 3.5 million rows of data, is it possible to add the entire column "used" WITHOUT LOOPING!!! lol, i don't want to transverse 3.5 million rows of data, so is there a mysql command to add all the 1's and 0's in the 'used' column quickly, efficiently, without overkill of mysql proccesses? lol.....
I know i'm asking for alot this christmas, but i've been a really good boy this year!!!!
lol...
Possible to ADD the total number of 3.5 million rows?
Moderator: General Moderators
looking into SUM() right now, hope this works...
Didn't work, any ideas?
Code: Select all
SUM(SELECT `used` FROM `table` WHERE `used` > 0)
COUNT(SELECT `used` FROM `table` WHERE `used` > 0)