首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

oracle统计无记要时,写默认值

2012-12-27 
oracle统计无记录时,写默认值?select ?nvl(max(t1.packagesize),0) ?from (? ? ? ? select decode(count(t

oracle统计无记录时,写默认值

?

select ?nvl(max(t1.packagesize),0) ?

from (

? ? ? ? select decode(count(t.per_bus_code),0,'1') per_bus_code,decode(count(t.buss_code),0,'1') buss_code,decode(count(t.per_code),0,'1') per_code?

? ? ? ? ? ?from t_tybook_back_pers_business t

? ? ? ? ? ?where t.per_code = 'TY-00000106'?

? ? ? ? ? ?and t.end_date > sysdate?

? ? ? ? ? ?and t.start_date<=sysdate ) t

left join t_tybook_before_business t1 on t.buss_code = t1.code?

group by t.per_code;

?

?

热点排行