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)
说明﹐左或右连接查询实际上是指定以哪个表的数据为准﹐而默认(不指定左或右连接)是以两个表中都存在关键列的数据的为准
内部连接是两个表中都必须有连接字段的对应值的记录数据才能检索出来
左连接是只要左边表中有记录数据就能检索出来而右边有的记录必要在左边表中有的记录才能被检索出来
右连接是只要右边表中有记录数据就能检索出来