📜  Mysql 案例总和 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:24.144000             🧑  作者: Mango

代码示例1
select sum(CASE WHEN payment_status = 'PAID' THEN paid_amount else 0 end) as paid,
       sum(CASE WHEN payment_status = 'Not Paid' THEN total_amount_due else 0 end) as due
from monthly_fee