1
什麼是PostgreSQL中的最佳方式,我想在一個領域與value = 1
算多少算多少數與value = 0
在同一領域A.PostgreSQL的計數(布爾表達式)
是這樣的:
select
count (field1 = value1) as filed1_ok,
count (field1 = value2) as filed1_bad,
extract(MONTH from rpt_date) AS mth
where rpt_date between frdate and todate
group by mth