2013年1月10日 星期四

Oracle : 存在則不回傳資料;不存在則回傳一筆資料

select ' ',' ',' '
  from dwmgr.mes_Tbl_wo_status
 where not exists (select null
                 from dwmgr.mes_Tbl_wo_status
                where zvbeln = :vbeln and zposnr = :posnr
                  and txt04 in('REL','CRTD')
              )
   and rownum <= 1

沒有留言:

張貼留言