Well, I have these columns in my table:
- wo_number
- crew_est
- manhour_est
- status ('FINISH' or NULL)
- progress (this isn't in the table)
I need to do this calculation for progress:
progress = SUM(crew_est * manhour_est) WHERE status = 'FINISH') / (SUM(crew_est * manhour_est) WHERE status IS NULL);
I need to do the calculation above and group the result by wo_number. I've looking for the answer anywhere but still no luck and I've no idea where to start.
Any help will be much appreciated. Thank you.