Jump to content

calculations from within a table.


Yammyguy

Recommended Posts

I have a quick question with respect to calculations within a table.  For example, let's use the following table:

 

hour

|

load GT1

|

load GT2

|

load ST

|

total

1

|

30

|

30

|

0

|

(sum of load GT1, GT2, ST)

2

|

40

|

20

|

3

|

(sum of load GT1, GT2, ST)

 

Is there a function or calculation I can add right in the mysql table under total, to automatically add the sum of the other columns?  I'd like to have mysql do it instead of adding to the PHP code - maybe just to skip a few steps??

 

Let me know if you need any more information. 

Thanks in advance!

 

~C.

Link to comment
https://forums.phpfreaks.com/topic/150664-calculations-from-within-a-table/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.