I have table columns workhours
and overtime
, and I would like to do a SQL or PHP query that checks if the workinghours are over 8 hours and if so it UPDATE
s the worked overtime to overtime column.
Here's my table:
id workinghours overtime
1, 4.79, ---
2, 8.73, ---
3, 7.97, ---
For example on the second row there is 8.73 hours of work and so it would update the 0.73 hours to the overtime column.