Syntax SUM IF :
Dibawah ini contoh syntaxnya :
SELECT created_date,shift,wo_code, SUM(IF(shift=1, qty, 0)) AS total FROM `data_lelco` WHERE shift=1 and wo_code='0000041741' GROUP BY wo_code
Dibawah ini contoh syntaxnya :
SELECT created_date,shift,wo_code, SUM(IF(shift=1, qty, 0)) AS total FROM `data_lelco` WHERE shift=1 and wo_code='0000041741' GROUP BY wo_code
Tidak ada komentar:
Posting Komentar