使用集函数 和 一般查询 的比较

两者都能看到 NSA01_DELAY 的count 条数

select uc_txn_id , scenario_status , count(1) cnt
from opgcep2.gcal_execution_task where created_at > systimestamp  - 2/24 group by scenario_status,uc_txn_id
having uc_txn_id is null and scenario_status = 'NSA01_DELAY';


select  count(1) cnt
from opgcep2.gcal_execution_task where created_at > systimestamp  - 2/24
and uc_txn_id is null and scenario_status = 'NSA01_DELAY'

猜你喜欢

转载自dannyhz.iteye.com/blog/2311008
今日推荐