Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在 SQL Server 2005 的更新语句的 from 部分中使用交叉应用子句?
你在哪里对,阿尔伯特。我做了一些测试,发现确实有可能。SELECT用法与语句中的相同。例如:
SELECT
UPDATE some_table SET some_row = A.another_row, some_row2 = A.another_row/2 FROM some_table st CROSS APPLY (SELECT TOP 1 another_row FROM another_table at WHERE at.shared_id=st.shared_id) AS A WHERE ...