Ok I think this is rather basic..
How would I do if I want to devide a value in a column with a value in another column in a table?
I want to devide the value in my column "vote_sum" with the value in "vote_tot",so that I get an average value and echo it. I'm not sure how to do this..//thanx
Devide columns
Moderator: General Moderators
Re: Devide columns
This isn't a coding question - it's a databases question. I've moved the topic to the appropriate forum.
Something like this should work:
[sql]SELECT vote_sum/vote_totalFROM some_table[/sql]
assuming vote_sum and vote_total aren't aggregate values.
Something like this should work:
[sql]SELECT vote_sum/vote_totalFROM some_table[/sql]
assuming vote_sum and vote_total aren't aggregate values.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.