本文主要向你介绍的是Oracle数据库中的(+)连接的实际操作,本文是以相关使用代码的描述来引出其实际的操作,你如果是Oracle数据库中的(+)连接的疯狂一族的话,就一起来看看吧!
1. 从表A.A1 (+) = 主表B.B1
复制代码SELECT
1.TO_CHAR(TBA.FBS_IO_DATE,'YYYY/MM/DD') A1
2.,TBA.TBA_TBD_NO A2
3.,TBB.TBB_NAME_S A3
4.,TBC.TBC_CHAR1 A4
5.,TBD.TBD_NAME A5
6.,TBA.TBA_SNS_NAME_SP A6
7.,TBA.TBA_TORI_KIN A7
8.,TO_CHAR(TBA.TBA_RPL_DATE,'YYYY/MM/DD') A8
9.FROM
10.SNTBATRN TBA
11.,ZMTBCMST TBC
12.,CMTBBMST TBB
13.,CMTBDMST TBD
14.WHERE
15.TBA.TBA_KAI_CODE = 'XXX'
16.AND TBA.TBA_KESHI_KBN = '0'
17.AND TBA.TBA_TAISYO_KBN IN ('0', '2')
18.AND TBB_KAI_CODE (+) = 'XXX'
19.AND TBB_BUN_CODE (+) = 'S001'
20.AND TBB_START_DATE <= SYSDATE
21.AND TBB_END_DATE >= SYSDATE
22.AND TBB.TBB_CODE (+)= TBA.TBA_STN_CODE
23.AND TBC.TBC_KAI_CODE (+) = 'XXX'
24.AND TBC.TBC_SUB_KBN (+) = 'SN'
25.AND TBD.TBD_KAI_CODE (+) = 'XXX'
26.AND TBD.TBD_CODE (+) = TBA.TBA_SNS_CODE
2. 主表A.A1 = 从表B.B1 (+)
1.复制代码
2.SELECT
3.TBA.TBA_1,
4.TBB.TBB_1,
5.TBC.TBC_1
6.FROM
7.TBA,
8.(SELECT TBB.TBB_1, TBB.TBB_2
9.FROM TBB
10.WHERE
11.TBB.TBB_3 LIKE '%NEWWEAPON%' TBB),
12.TBC
13.WHERE
14.主表TBC
15.TBA.TBA_A > 2
16.从表TBB
17.AND TBA.TBA_2 = TBB.TBB_2
18.从表TBC
19.注意TRIM
20.AND TRIM(TBA.TBA_3) = TRIM(TBC.TBC_3 (+))