G
Guest
SELECT DISTINCT LOCAL_Sales.SaleID, LOCAL_Sales.Date, LOCAL_Sales.CardRecordID, LOCAL_Sales.InvoiceStatusI
FROM LOCAL_Sale
UNION SELECT DISTINCT HISTORY_Sales.SaleID, HISTORY_Sales.Date, HISTORY_Sales.CardRecordID, HISTORY_Sales.InvoiceStatusI
FROM HISTORY_Sales LEFT JOIN LOCAL_Sales ON HISTORY_Sales.SaleID = LOCAL_Sales.SaleI
WHERE LOCAL_Sales.SaleID Is Null
This returns exactly every reord in "LOCAL_Sales" as well as every record in "HISTORY_Sales" not duplicated in "LOCAL_Sales". My question is: how is the SaleID field in the WHERE clause interpreted as applying only to the JOIN clause and not the SELECT clause
Cheer
ALi
FROM LOCAL_Sale
UNION SELECT DISTINCT HISTORY_Sales.SaleID, HISTORY_Sales.Date, HISTORY_Sales.CardRecordID, HISTORY_Sales.InvoiceStatusI
FROM HISTORY_Sales LEFT JOIN LOCAL_Sales ON HISTORY_Sales.SaleID = LOCAL_Sales.SaleI
WHERE LOCAL_Sales.SaleID Is Null
This returns exactly every reord in "LOCAL_Sales" as well as every record in "HISTORY_Sales" not duplicated in "LOCAL_Sales". My question is: how is the SaleID field in the WHERE clause interpreted as applying only to the JOIN clause and not the SELECT clause
Cheer
ALi