https://alicloud.my.id/2024/05/29/advanced-sql-conditional-aggregation/