您在帮助中了吗?这是一个简单的例子:
MERGE dbo.commissions_history AS targetUSING (SELECT @amount, @requestID) AS source (amount, request)ON (target.request = source.request)WHEN MATCHED THEN UPDATE SET amount = source.amountWHEN NOT MATCHED THEN INSERT (request, amount) VALUES (source.request, source.amount);
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)