oracle中left on确立两个表在某些条件下,存在与A表中,却不在D表中的语句

--6、未到站次
select A.C_OP_CTS_Z_A_104
from tab_omin_op_cts_z_a_1 A left join tab_omin_cts_di_1 D
on (
    A.C_OP_CTS_Z_A_104 = D.S_F_NAME and
    D.data_id='A.0001.0009.R001' AND
    D.record_date='2018-03-26' AND
    D.info_detail_hour='07:00' AND
    D.process_period=2
    )
where
  (
    A.C_OP_CTS_Z_A_102='A.0001.0009.R001' AND
    A.C_OP_CTS_Z_A_101='2018-03-26' AND
    A.C_OP_CTS_Z_A_103='07:00' AND
    A.C_OP_CTS_Z_A_109 like '23%' and 
    D.S_F_NAME IS NULL
   )
ORDER BY A.C_OP_CTS_Z_A_104

猜你喜欢

转载自blog.csdn.net/watcher0111/article/details/79699137
今日推荐