0
我對SQL比較陌生,對於Oracle來說是一個完整的初學者,並且難以理解(+)語法。考慮下面的查詢:Oracle外連接(+)語法
SELECT *
FROM CustomerShip,
(SELECT DISTINCT b.ShipSeq AS shipSeq
FROM Orders a,
CustomerShip b
WHERE a.OrderId IN (SELECT OrderId
FROM Orders
WHERE CustomerId = @CustomerId
AND OrderType <> 'A')
AND b.CustomerId = @CustomerId
AND b.ShipSeq = a.CustShip
AND OrderStatus <> 'C'
GROUP BY b.ShipSeq) i
WHERE CustomerId = @CustomerId
AND (Address NOT LIKE '%RETAIL%STORE%')
AND ShipSeq = i.ShipSeq(+)
ORDER BY ShipTo DESC, OrderDate DESC;
所以我收集(+)的甲骨文是一個outer join
,但我很困惑什麼是加盟嗎?內部查詢結果爲i
。我需要重寫這個查詢MSSQL
,並不確定它會是什麼樣子?
「我對SQL比較陌生」。 。 。那麼,不要學習過時的,過時的語法。即使Oracle建議使用顯式外連接。 –
我不是。我正在重新編寫一段前面寫過的查詢。 – PixelPaul