关于oracle外连接的问题

我写了一个sql如下:

select *
  from storage_market_fetch          f,
       storage_market_fetch_mat      m,
       storage_mar_fetch_collect_mat fm
 where f.fetch_bill_id = m.fetch_bill_id
   and m.mat_info_id = fm.mat_info_id(+)
   and f.is_deleted = 0
   and f.is_returned = 0
   and f.step = 9
   and fm.mat_info_id is null
   and m.pay_price is not null

我现在需要在fm表中加一个条件,就是加fm.is_disabled = 0这样一个条件,如果直接加在where条件的后面,是不行的,那么除了先查询记录再外连接的这种方法外,还有没有其他的方法,我这样写对不对,请高手指点一下。

select *
  from storage_market_fetch          f,
       storage_market_fetch_mat      m,
       storage_mar_fetch_collect_mat fm
 where f.fetch_bill_id = m.fetch_bill_id
   and m.mat_info_id = fm.mat_info_id(+)
   and f.is_deleted = 0
   and f.is_returned = 0
   and f.step = 9
   and fm.is_disabled(+) = 0
   and fm.mat_info_id is null
   and m.pay_price is not null

  就是在连接条件中加了and fm.is_disabled(+) = 0的条件,不知道对不对。 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值