Is it possible to have an equation/formula in the table value of a MySql database. What I need is for column1 to be divided by column2 (c1/c2) and stored in column3.
Thanks MiniMitt
Why would you bother storing it you could just caluclate it on the fly in a select statement such as
SELECT (c1/c2) AS c3 FROM table
I would need to print the value of c3 on my web site on a print form. Will the Select statement keep c3 the value of c1/c2?
If you use a query in that format then the value of c3 would be c1/c2, however this is calculated when ever the query is run. If c1 or c2 changes then c3 would also change.
In a real database you could solve this using a 'view' or a stored procedure.
(c1/c2) is 'derived data' and should therefore not be stored in there database at all.