This commit is contained in:
Yam ZhengLim
2023-07-13 15:26:52 +00:00
parent 77f4144c74
commit c9e81d9958
@@ -21,7 +21,7 @@ company_agg AS (
companies.company_marking_id,
companies.company_created_datetime,
COUNT(transaction_orders.transaction_order_id) AS count_order,
COUNT(IFF(transaction_orders.order_status = 'completed', transaction_orders.transaction_order_id, null)) AS count_completed_order,
COUNT(IFF(transaction_orders.order_status = 'COMPLETED', transaction_orders.transaction_order_id, null)) AS count_completed_order,
MAX(transaction_orders.order_created_datetime) AS last_order_datetime,
COALESCE(last_order_datetime, company_created_datetime) AS last_activity_datetime,
IFF(companies.company_created_datetime < '2021-07-01', 1, 0) AS is_wrong_created_datetime_company,