-1
我想結合這些查詢,但沒有運氣。我需要能夠維護結果中的所有列。我怎樣才能做到這一點?如何合併我的兩個查詢?
這是我的查詢:
SELECT c.CustomerID, EmailAddress, LastName, FirstName, Line1 AS BillLine1, Line2
AS BillLine2, City AS BillCity, State AS BillState, ZipCode AS BillZip FROM
Customers c JOIN Addresses ON c.BillingAddressID = Addresses.AddressID
SELECT Line1 AS ShipLine1, Line2 AS ShipLine2, City AS ShipCity, State AS ShipState,
ZipCode AS ShipZip FROM Customers b JOIN Addresses ON b.ShippingAddressID =
Addresses.AddressID;
定義'combine' –
我真的希望你是不是在利用總體規劃對查詢工會... –
一個工會是行不通的,這就是爲什麼我在這裏尋求幫助。此外,UNION需要相同數量的列,如果我使用了UNION,它將刪除第二個查詢中的列。 – CandyCane