首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

ORACLE 左联接 left join

2012-08-22 
ORACLE 左连接 left joinORACLE 左连接:1.使用(+)表示:SELECT A.OID,?????? A.VALUE,?????? A.NE_TYPE_OID

ORACLE 左连接 left join

ORACLE 左连接:
1.使用(+)表示:
SELECT A.OID,
?????? A.VALUE,
?????? A.NE_TYPE_OID,
?????? NVL(B.STATUS, '1') STATUS,
?????? A.TYPE,
?????? A.STARTTIME START_TIME
? FROM ALARM_E A, ALARM_E_CLEAR_TIME B
?WHERE A.OID = B.ALARM_EVENT_OID(+);???????

??????????????

2.使用left join表示:
SELECT A.OID,
?????? A.VALUE,
?????? A.NE_TYPE_OID,
?????? NVL(B.STATUS, '1') STATUS,
?????? A.TYPE,
?????? A.START_TIME
? FROM (select OID,
?????????????? KPI_DEFINE_OID,
?????????????? ALARM_DEFINE_OID,
?????????????? ALARM_THRESHOLD_LINE_OID,
?????????????? THRESHOLD_VALUE,
?????????????? REPORT_TIME,
?????????????? SLICE_TYPE,
?????????????? VALUE,
?????????????? COLOR_LEVEL,
?????????????? COMP_TYPE,
?????????????? NE_OID,
?????????????? NE_TYPE_OID,
?????????????? TYPE,
?????????????? STARTTIME START_TIME
????????? from ALARM_E) A
? left join (select STATUS, ALARM_EVENT_OID, END_TIME
?????????????? from ALARM_E_CLEAR_TIME) B on A.OID = B.ALARM_EVENT_OID;

?

上面的两个左连接语句显示的结果是相同的,左连接,(+放在等号的右边)

热点排行