PDA

View Full Version : MySQL query to change min/maxcash


cavedude
02-04-2005, 05:42 AM
Does anybody know what syntax I would use to divide all the values in a given column by a certain decimal? In other words, I want to play around with coin drops and I want to reduce the values in the min and maxcash columns by X% with as few queries as possible. I've tried a few different ways so far but they either came back with a syntax error or reduced all the values to 0. Thanks for any help.

Cisyouc
02-04-2005, 08:03 AM
UPDATE tablename SET columnname=columname*decimalvalue WHERE restriction=whatever;

(I think)

cavedude
02-04-2005, 08:28 AM
Thanks a lot! That's perfect. I never tried 'columnname=columname*decimalvalue' although now that makes perfect sense. Without it, I would be multiplying 0 by the decimal, which would explain all those times I ended up with all 0s :)