0
我有一個表,客戶,它看起來有點像這樣:結合SQL WITHs
CustomerID cobuyerID
001 005
002
003 006
004
005
006
我能用得到一組客戶和一組cobuyers的?因此,像:
;WITH Customers as
(
SELECT * FROM Customers where (* WHERE CustomerID not in cobuyerID*)
),
Cobuyer as
(
SELECT * FROM Customers where (*WHERE CustomerID only in cobuyerID*)
),
http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem – Mihai