问题描述
- 这个语句如何优化把临时表去了
-
Select ID,Count(*) as num1 into #t1 from table1 where type=1 Group by IDSelect ID,Count(*) as num2 into #t2 from table1 Group by ID
Update table2 Set table2.a=1 Where table2.ID in(Select A.ID from #t1 A Join #t2 as B On B.ID = A.ID And num1= num2)
时间: 2024-10-28 06:12:52