用group by 汇总时没有的数据如果在汇总的条件里没有数据他就不显示,请问如何解决?如
select a.swjg_dm,'本期合计' swjg_mc,nvl(to_char(count(distinct zdyj_dm)),0) zdyj_lm,nvl(count(swrybh),0) swry_count from v_zdyjgc a,zd_swjg b
where a.swjg_dm=b.swjg_dm
and a.swjg_dm='213030400'
and gclx_dm=0
and yjrq between '2005-01-01' and '2005-02-01'
group by a.swjg_dm
结果什么都没返回
请问如何在没有数据时让汇总值显示为0
让他有一天纪录
select a.swjg_dm,'本期合计' swjg_mc,nvl(to_char(count(distinct zdyj_dm)),0) zdyj_lm,nvl(count(swrybh),0) swry_count from v_zdyjgc a,zd_swjg b
where a.swjg_dm=b.swjg_dm
and a.swjg_dm='213030400'
and gclx_dm=0
and yjrq between '2005-01-01' and '2005-02-01'
group by a.swjg_dm
结果什么都没返回
请问如何在没有数据时让汇总值显示为0
让他有一天纪录
select a.swjg_dm,'本期合计' swjg_mc,
你这是什么写法、实现: 请问如何在没有数据时让汇总值显示为0
我建议你在程序里写
----------
0