update tblB B
set fQty=(select sum(fQty) from tblA A where A.fWidth>=B.fWidth1 AND A.fWidth<=B.fWidth2)
set fQty=(select sum(fQty) from tblA A where A.fWidth>=B.fWidth1 AND A.fWidth<=B.fWidth2)
--改
update tblB
set fQty=(select sum(fQty) from tblA A where A.fWidth>=B.fWidth1 AND A.fWidth<=B.fWidth2)
from tblB B
set
fQty=A.fQty
from
tblB B,
tblA A
where
A.fWidth between B.fWidth1 and B.fWidth2
set
fQty=(select sum(fQty) from tblA where fWidth between B.fWidth1 and B.fWidth2)
from
tblB B