update tnhyb set yhs=(select cnt from (select hydm,count(*) cnt from tancalchis where yysname='大用户' and month='200411' group by hydm) t1 where tnhyb.tradecode=t1.hydm)
where exists (select 1 from (select hydm,count(*) cnt from tancalchis where yysname='大用户' and month='200411' group by hydm) t1 where tnhyb.tradecode=t1.hydm)
where exists (select 1 from (select hydm,count(*) cnt from tancalchis where yysname='大用户' and month='200411' group by hydm) t1 where tnhyb.tradecode=t1.hydm)
where exists (select 1 from (select hydm,count(*) cnt from tncalchis where yysname='大用户' and month='200411' group by hydm) t1 where tnhyb.tradecode=t1.hydm)
不过也不知是什么原因,这条语句运行了足有两三分钟。数据库中也就不超过1万条记录。
给咱讲讲update批量更新的绝技吧?!!!!
期待ing!!!!!
讲完再送80分;
谢谢大家了!