直接上代码和图片了
SELECT
dt,
if(tasksource=0 and sceneid=335,`总审出`,null) `yongshen`
from(
SELECT
dt
,sceneid
,tasksource
,count( DISTINCT entityid ) as `总审出`
from hdp_ubu_xxzl_defaultdb.dwd_t04_manaudit_record_d
where dt ='20210825'
and sceneid in ('53','335','99')
and tasksource in ('0','19999','1')
group by
dt
,sceneid
,tasksource)aaa
子查询的执行结果
整个代码的结果