create or replace view V_WTK_ALL as
select aid oshort as FindDeptName urealname as FindUserName fname as FindWay oshort as ProblemAtDeptName
zname as szzz ayhnr sname as SSZY kname as kind wname as whhg azgcs azgfzr aplandate afinishdate
urealname as jdr urealname as fxr ayqzt ayqdate awtkzt
from WTK a ORGANIZATION o ORGANIZATION o OPERATORS uOPERATORS uOPERATORS u Kind k Findway f SPfield s SZZZ z WHHG w
where afinddeptid =oid(+) and aproblematdeptid=oid(+) and afinduserid=uid(+) and ajdr=uid(+) and afxr=uid(+)
and akindid=kid(+) and afindwayid=fid(+) and aspfieldid=sid(+) and aszzid =zid(+) and awhhgid=wid(+)
有兩個表
table
user_id user_name user_pss
aaa a
bbb b
ccc c
table
user_id user_power
使用sql語句查詢
正常狀態:
select tableuser_id
tableuser_name
tableuser_power
from tabletable
where tableuser_id = tableuser_id
但是這樣檢索到的數據只有兩條:
user_id user_name user_power
aaa
bbb
輸入你想轉換的文字內容
點擊下面按鈕進行在線轉換
select tableuser_idtableuser_nametableuser_power
from tabletable
where tableuser_id (+)= tableuser_id
就可以得到如下的結果
user_id user_name user_power
aaa
bbb
ccc (null)
說明﹐左或右連接查詢實際上是指定以哪個表的數據為准﹐而默認(不指定左或右連接)是以兩個表中都存在關鍵列的數據的為准
內部連接是兩個表中都必須有連接字段的對應值的記錄數據才能檢索出來
左連接是只要左邊表中有記錄數據就能檢索出來而右邊有的記錄必要在左邊表中有的記錄才能被檢索出來
右連接是只要右邊表中有記錄數據就能檢索出來
From:http://tw.wingwit.com/Article/program/Oracle/201311/18523.html