looking for some solutions? You are welcome.

SOLVED: Count row with month and other condition

Henry Wilson:

I know we can count rows easily, but i have some problem doing that.

this is my table

I tried to count row where the value is not equal to '-' in each month. This query below counts all row in all months.

SELECT MONTHNAME(tanggal) as bulan,
(SELECT COUNT(iad) FROM triwulan WHERE iad!='-') as iadp,
(SELECT COUNT(isk) FROM triwulan WHERE isk!='-') as isk,
(SELECT COUNT(vap) FROM triwulan WHERE vap!='-') as vap,
(SELECT COUNT(hap) FROM triwulan WHERE hap!='-') as hap,
(SELECT COUNT(plebitis) FROM triwulan WHERE plebitis!='tidak') as plebitis
FROM `triwulan`
group by bulan

I would appreciate any help, thank you..



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent