下图中的亮点显示了我想要实现的逻辑。我意识到语法不正确。 ) f/ n' }% {$ z# u只有当目标表中列出的值为空,源表中的对应值不为空时,才能有条件更新MERGE句子中的记录吗? 5 T' H' T, G; W$ ]如何建议重写? 8 d. A9 B4 Q/ M }! j9 r5 P2 MMERGE dbo.input_311 AS [t]USING dbo.input_311_staging AS <strike>ON ([t].[unique key] = <strike>.[unique key])WHEN NOT MATCHED BY TARGET THEN INSERT(t.[Created Date]) VALUES(s.[Created Date])WHEN MATCHED THEN UPDATE SET(t.[Created Date] = s.[Created Date] WHERE s.[Created Date] IS NOT NULL AND t.[Created Date] IS NULL)OUTPUT deleted.*,$action,inserted.*;GO , ^) d+ s& P( c5 U+ Y 解决方案: & E2 X, O7 ^( }" X 也许可以用When Matched And (s.[Created Date] Is Not Null And t.[Created Date] IsNull) Then Update ...。