한 테이블의 컬럼에 마진율을 넣어 그 마진율을 매입가격에 넣어 매출가격으로 나타내고있는데요..
insert into sellingPrice( dealerCode, materialCode, startDay, sellerCode, sellingPrice, modifierId, modifierDate) values( @A_dealerCode, @A_materialCode, @A_startDay, @C_sellerCode, @A_sellingPrice, @A_modifierId, getDate()) insert into buyingPrice( dealerCode, buyercode, materialcode, startday, buyingprice, storeprice, isvat, seq, modifierid, modifierdate) select @A_dealerCode, clientCode, @A_materialCode, @A_startDay, round(@A_sellingPrice*((rate2/100.0)+1),-1), round(@A_sellingPrice*((rate2/100.0)+1),-1), @C_isVat, NULL, @A_modifierId, GETDATE() from Client where dealerCode=@A_dealerCode and clientGubun='1' and rate2 > 0
코드는 이런식으로 매입가격을 프로시저로 받으면 매출가격도 client테이블의 client마다 마진율을 매기고 마진율이 0 초과인것만 계산해서 INSERT 시키고있는데
이 매입가격을 수정하면 매출가격도 바뀌게하고싶은데
update문을 어떻게 해야할지 모르겠습니다.. 계속 수정을 해봐도 잘 안됩니다
어떤식으로 update문을 짜야할까요