Page 1 of 1

Is this even possible?

Posted: Mon Dec 15, 2003 7:29 pm
by Local Reaction
Here is my situation, I need to have mysql do a COUNT(*) in "column C" to see how many times lets say the number 5 appears in that column, and if that number 5 appears more than lets say 10 times, I need for that number 5 to correspond to "row 5" and change another column, "column B" in "row 5" to lets say the number 50. Got it? Anyone know how to do this? Ive been trying to figure it out in my head for a week but I just dont know how to do it. I have done extensive google searches but have come up empty handed.

Is this sort of thing even possible to do?

I deeply thank in advance anyone who can help me out.

Posted: Tue Dec 16, 2003 2:25 am
by twigletmac
Could you provide more information on why you want to do this - it's not generally a good idea to store the results of calculations on db data in the database as it's often difficult to maintain. Maybe there's another way of structuring the database?

Mac

Posted: Tue Dec 16, 2003 2:54 am
by m3mn0n
Sure. It's a snap with the [php_man]mysql[/php_man] functions and some long hours coding with trusty caffine by your side. :)

Posted: Tue Dec 16, 2003 2:45 pm
by Paddy
twigletmac wrote:Could you provide more information on why you want to do this - it's not generally a good idea to store the results of calculations on db data in the database as it's often difficult to maintain. Maybe there's another way of structuring the database?

Mac
I might be wrong but a database is not normalised with calculated data in it. Just another point.