I want to multiply 4 with number of faults if faulttype='business' and faultseverity='fatal', using query listed below;
Select faulttype, IF (faulttype='business' AND faultseverity='fatal', 1,0)* 4 FROM tbl_fault WHERE product='DAS' AND faultdistribution='missed'
group by faulttype
I am getting result business instead of numeric value, What should be corrected in this query?
Regards
faulttype, the second will be the numeric value.$cresult[0]: the first index is the first column. Use$cresult[1]for the second column.