1
我不太確定正確的方法來查看兩行數據庫中是否存在行。請幫忙。如何檢查兩行數據庫中是否存在行?
@pStoreNum bigint,
@pGuid varchar(100)
IF EXISTS (SELECT Guid FROM dbo.StoreSales WHERE Guid = @pGuid
AND SELECT Guid FROM dbo.StoreReporting WHERE Guid = @pGuid)
BEGIN
UPDATE
dbo.StoreReporting
SET
ValidCount = ValidCount + 1
WHERE
StoreNum = @pStoreNum
END
+1 - 比'INNER JOIN' – JNK
感謝亞倫更具擴展性!我也給你一個贊成JNK。 –