Aeron Mendoza Aeron Mendoza - 1 month ago 6
MySQL Question

Subtracting 2 columns in MYSQL

Hi I wanna subtract Coverage from Bill and Put it in Total from my Table TotalBill

It's going to be like this:
Bill - Coverage = Total

+------+-----------+-------+

| Bill | Coverage | Total |

+------+-----------+-------+

| 1300 | 300 | NULL |

| 2000 | 1600 | NULL |

+------+-----------+-------+

Answer Source

Looks like your are looking for this

   UPDATE 
     TotalBill
   SET 
     Total = Bill - Coverage