带左连接的输出子句,如何?
是否有可能做类似的规定:带左连接的输出子句,如何?
DELETE TOP(1) m FROM MyTable m
OUTPUT deleted.*
LEFT JOIN MyOtherTable ON MyOtherTable.SomeColumn=s.SomeColumn
我知道这个工程:
DELETE TOP(1) FROM MyTable
OUTPUT deleted.*
而且这也可以(但无意义):
DELETE TOP(1) m FROM MyTable m
LEFT JOIN MyOtherTable ON m.SomeColumn=MyOtherTable.SomeColumn
回答:
移动OUTPUT
条款到JOIN
DELETE TOP(1) m OUTPUT deleted.*
FROM MyTable m
LEFT JOIN MyOtherTable ON MyOtherTable.SomeColumn=s.SomeColumn
以上是 带左连接的输出子句,如何? 的全部内容, 来源链接: utcz.com/qa/261718.html