更新欄我寫了下面的查詢中MySQL
:SQL - 通過計數
UPDATE mytable atable,
(SELECT address_one, address_two, COUNT(*) cnt FROM table
GROUP BY address_one, address_two) btable SET atable.address_count = btable.cnt
WHERE atable.address_one = btable.address_one AND atable.address_two = btable.address_two
它計算多少address_one
和address_two
在表中列出,並存儲在各自的ADDRESS_COUNT數量。
但是,這工作正常MySQL
但不是在SQL Server
。我如何解決這個問題SQL Server
?
請提供具體的錯誤消息或意外行爲的描述。 – Shadow