Oracle sql not in 多欄位比對樣本,oraclesql

來源:互聯網
上載者:User

Oracle sql not in 多欄位比對樣本,oraclesql
select * from (select t2.cadastralno parcelid,t1.pkid taxpayerid,t2.taxtype taxtype,t1.booktype taxpayertype,
        t2.cadastralno parcelCadastralno,t2.landuser parcelLanduser,t1.payername taxpayerPayername 
         from grid_sysdb.bss_taxpayers t1,grid_sysdb.bbs_parcel t2,grid_sysdb.djsw_tddjxx t3 
        where t3.nsrdzdah = t1.pkid and t1.payername = t2.landuser)

        where (parcelid,taxpayerid) not in(select p.parcelid,p.taxpayerid from bss_parceltaxpayerrel p)


not in多個欄位


Oracle sql語句中not in有什作用

a not in(1,2,3) 意思是不等於 1,2,3(括弧所列的值)的所有的值, where a not in (1,2,3) 可以用 where a!=1 and a !=2 and a!=3 代替,執行結果完全相同。
 
怎用PL/SQL對oracle兩個表的資料做比對,建立oracle視圖結果集

例子:merge into test1 t1
using test2 t2
on (t1.id = t2.id)
when matched then
update set t1.name = t2.name
when not matched then
insert values(t2.id,t2.name)
--這個相當於條件判斷,這個例子的含義包括了update和insert,所以可以通俗理解為和檔案粘貼複製後直接替換一樣。
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.