反馈人:缪金荣

select
strategy_id,
sum(case when status = 4 and update_time between 2025-10-28 00:00:00 and 2025-10-28 23:59:59 then 1 else 0 end) as successTotal,
sum(case when status in (3, 5, 7) and update_time between 2025-10-28 00:00:00 and 2025-10-28 23:59:59 then 1 else 0 end) as failTotal,
sum(case when status = 0 then 1 else 0 end) as waitTotal
from
t_strategy_execute_queue_publish_ozon
WHERE strategy_id in
(
53
,
50
,
44
,
40
,
38
)
group by strategy_id
优化建议:如果一天查一次或者页面查,改查starrocks,如果是跑批任务,将全量统计和时间段统计拆成2个SQL分别统计(可能效果也不是很好)
