select count((*)为空,如何显示0
小新蜡笔 2015-04-22 03:37:26 三张表关联查询,记录个数,执行完select语句,显示为空,希望为空的时候能为0,该怎么弄
select count(*) as FILE_COUNT,
b.work_path||'60990600011000000036BUS23002_'||to_char(sysdate, 'yyyymmdd')||'_B00_000_0000.txt' as FILE_NAME from file_exp_midd_t b, (
select '609906',a.cust_node_id,a.cust_node_cd,a.cust_list_level,c.cust_number,a.common_region_id,c.cust_name
from gem_owner_user.cust_tree_node a ,gem_owner_user.cust_tree_rel b ,cust c
where a.cust_node_id=b.cust_node_id
and b.cust_id=c.cust_id and a.ext_cust_node_id is not null
union
select '609906',a.cust_node_id,a.cust_node_cd,a.cust_list_level,to_char(c.cust_id),a.common_region_id,c.cust_name
from gem_owner_user. cust_tree_node a ,gem_owner_user.cust_tree_rel b ,gem_owner_user.CUST_VIRTUAL c
where a.cust_node_id=b.cust_node_id
and b.cust_id=c.cust_id and a.ext_cust_node_id is not null)where b.param_id='exp_jihe_real' group by b.work_path
结果为FILE_COUNT为空。