怎样将b表中所有字段cWhCode数据相同的iQuantity相加,并将相加的结果加入到重新建立的a表中?
dxlth 2003-04-03 11:38:47 例如:
表a
iIsId int identity (1,1) not null,
cCode varchar(20) not null ,
cName varchar(40) null ,
benyueqichu float default 0 ,
benyueruku float default 0 ,
benyuechuku float default 0 ,
benyueleft float default 0 )
表b
iIsId int identity (1,1) not null,
dDate DateTime not null ,
cMth varchar(6) not null ,
cOrderNo varchar(12) not null ,
dInDate DateTime null ,
iLineNo int not null ,
cCaseNo varchar(20) null ,
cCode varchar(20) not null ,
cName varchar(40) null ,
cStd varchar(30) null ,
cUnit varchar(10) null ,
iQuantity float default 0 ,
iOutQty float default 0 ,
iBalQty float default 0 ,
iPrice float default 0 ,
cWhCode varchar(20) null ,
cWhName varchar(40) null ,
cPrdCCode varchar(10) null ,
cPrdCName varchar(40) null ,
cInType varchar(10) null ,
cRemark varchar(60) null )