0

我想获取以下查询的结果并对 NAME_UD_AFFILIATIONS 执行更新并将 Member_Status 字段设置为 N。

我正在使用 SQL Server Management Studio 2005 Ver。Windows 7 上的 9.0

SELECT *
FROM NAME
INNER JOIN Name_UD_Affiliations ON NAME.ID=Name_UD_Affiliations.ID
WHERE 
NAME_UD_AFFILIATIONS.Member_Status='R' and 
Name.Join_Date > '2012-9-1' and 
Name.Paid_Thru > '2013-09-01'
4

1 回答 1

5

使用 SQL-Server 你可以做到

UPDATE Name_UD_Affiliations 
SET Member_Status = 'N'
FROM NAME
 INNER JOIN Name_UD_Affiliations ON NAME.ID=Name_UD_Affiliations.ID
WHERE NAME_UD_AFFILIATIONS.Member_Status='R'
AND Name.Join_Date > '2012-9-1'
AND Name.Paid_Thru > '2013-09-01'
于 2013-03-08T15:26:41.757 回答