i want to calculating one row at table "counter". i try to make my table like:
name black yellow white qty_job total
david 1 0 0 2 ?
andrew 0 1 1 4 ?
the formula to calculate is :
total = (nblack * 1) + (nyellow * 1) + (nwhite * 0.4) / qty_job
total = (1 * 1) + (0 * 1) + (0 * 0.4) / 2 = 0.5
how to insert this formula at mysql code? especially at SELECT method.