Within a MYSQL database, is it possible to set up a column as a function (similar to Excel) For example if I have a column titled "sales" and a column titled "Costs" can I set up a column called "Profit" that will automatically subtract "Costs" from "Sales"?
Not quite, however you can set up a query that returns that information as a column, however no actual column exists.
for instance:
SELECT column1, column2, (column1-column2) as result FROM mytable.
And it will return 3 columns. the last one having the value of the operation of column1 minus column 2
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.