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为空。
...全文
1781 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
小灰狼W 2015-04-22
  • 打赏
  • 举报
回复
因为没有路径,所以就没有路径条目以及对应的计数了。如果你希望路径对应条数为空时,该路径的count字段显示0,那么还需要一个全部路径的列表
小新蜡笔 2015-04-22
  • 打赏
  • 举报
回复
引用 1 楼 wildwave 的回复:
那么此时 b.work_path要显示什么
显示一个文件路径。现在count(*)为空,这个work_path也不显示了。。。
小灰狼W 2015-04-22
  • 打赏
  • 举报
回复
那么此时 b.work_path要显示什么

17,382

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧