2 yhkey yhkey 于 2014.10.14 16:34 提问

这个语句如何优化把临时表去了

Select ID,Count(*) as num1 into #t1 from table1 where type=1 Group by ID

Select 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)

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!