欢迎投稿

今日深度:

Oracle sql not in 多字段比对示例,oraclesql

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,所以可以通俗理解为和文件粘贴复制后直接替换一样。
 

www.htsjk.Com true http://www.htsjk.com/shujukunews/3227.html NewsArticle 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 taxpa...
评论暂时关闭