I created a mysql table with the following columns ...
item_price, discount, delivery_charge, grand_total
The value item_price, discountand delivery_chargeeverything varies depending on the item in question, and they will be filled in manually.
I would like mysql to populate a value in a column grand_totalbased on values item_price, discountand delivery_chargeusing the following formula ...
grand_total = item_price - discount + delivery_charge
Is there any way to specify the formula for this column when creating the table structure in mysql? I know that this can be done with php, but I prefer the database to do this automatically for me, if possible.
source
share