FROM dbo.SampleInspect si
WHERE EXISTS
(
SELECT 1
FROM dbo.Project p
INNER JOIN dbo.Customer c
ON c.CustomerID = p.CustomerID
INNER JOIN dbo.SampleRevision sr
ON sr.PJ_RowID = p.PJ_RowID
INNER JOIN dbo.SampleReceive src
ON src.SR_RowID = sr.SR_RowID
INNER JOIN dbo.Supplier sp
ON sp.SupplierID = src.SupplierID
WHERE si.SRC_RowID = src.SRC_RowID
AND si.AddDate >= IsNull(@BeginDate, si.AddDate)
AND si.AddDate < DateAdd(day, 1, ISNULL(@EndDate, si.AddDate))
AND (p.SampleID = ISNULL(@SampleID, p.SampleID) OR sr.SampleRevID = ISNULL(@SampleID, sr.SampleRevID))
ANDp.CustomerID = ISNULL(@CustomerID, p.CustomerID)
)
问题一: Exists是不是也可以用IN关键字来代替?
问题二: "SELECT 1"中的"1"在语句中是什么意思?