join 的记录

select f.CONTRACT_CODE 资源编号,

       p2.deptname     片区,

       f.DUTY_DEPTNAME 责任店面,

      

       f.duty_username 责任人,

      

       f.input_date 录入时间,

       f.house_tel  资源电话,

       u.tel        责任人电话,

       u.yun_tel    责任人云总机,

       f.if_public  备案OR公盘

  from mm_fyinfo f

 

  join(select a.tel tel

          from oy_user a

         where a.ifdeleted =0

           and a.tel isnotnull

           and a.username <>'系统管理员'

        union

        select b.yun_tel tel

          from oy_user b

         where b.ifdeleted =0

           and b.yun_tel isnotnull

           and b.username <>'系统管理员') v

    on f.status ='有效'

     

      --and f.input_date > date '2009-01-01'

   and f.ifdeleted =0

   and f.If_Tzcd =0

   and f.Consign_Type <>'限时代理'

      --and f.duty_deptname like '%谈固%'

   andinstr(f.house_tel, v.tel)>0

  join oy_user u

    on u.user_id = f.duty_userid

  join oy_department p

    on f.DUTY_DEPTID = p.deptid

  join oy_department p2

    on p.pid = p2.deptid

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值