原来sql语句:
update [dbo].[TableA]
set ColumnA=Count(*)
from [dbo].[TableB]
改后:
update [dbo].[TableA]
set ColumnA=tmpTable.ColumnB
from(
select Count(*) as ColumnB
from [dbo].[TableB]
)tmpTable
SQL Error:An aggregate may not appear in the set list of an UPDATE statement.
最新推荐文章于 2022-10-05 15:13:28 发布