OracleSQL语句用临时表对子查询进行左连接
SELECT AAA.*, CC.END_TIME FROM(select AA.lot_id, AA.lot_status, BB.START_TIME
from wiplotsts AA left join (select B.LOT_ID, MIN( A.tran_time) AS START_TIME from wiplothis A JOIN WIPLOTSTS B ON A.LOT_ID=B.LOT_ID where tran_code="START" group by B.lot_id ) BB
on AA.LOT_ID=BB.LOT_ID
WHERE AA.LOT_CMF_2="H1813.01"
) AAA LEFT JOIN
(select B.LOT_ID, MAX( A.tran_time) AS END_TIME from wiplothis A JOIN WIPLOTSTS B ON A.LOT_ID=B.LOT_ID where tran_code="END" group by B.lot_id ) CC
on AAA.LOT_ID=CC.LOT_ID ;
以上是 OracleSQL语句用临时表对子查询进行左连接 的全部内容, 来源链接: utcz.com/z/511920.html