ç»ä½ ä¸ä¸²ä»£ç ï¼å¨æ°æ®åºä¸æ§è¡ä¸ä¸ï¼è®°å¾å
å¤ä»½å¸å¥ï¼
exec sp_cleanitemdetailv
go
update a set a.fdetailcount=b.Fcount
from t_itemdetail a join (select Fdetailid,count(*) as Fcount from t_itemdetailv
where fitemid=-1 group by Fdetailid) b
on a.fdetailid=b.fdetailid where a.fdetailcount<>b.Fcount
go
温馨提示:答案为网友推荐,仅供参考