我米具有表乘以同一表中的两列和
SALES(sno,comp_name,quantity,costperunit,totalcost)
供给costperunit
值之后存储结果到相同的表的第三列,totalcost
需要被计算为"totalcost=quantity*costperunit".
我想将'quantity'
和'costperunit'
列相乘,并将结果存储在同一表的'totalcost'
列中。
我已经试过这样:
insert into SALES(totalcost) select quantity*costperunit as res from SALES
但它失败!
有人请帮我实现这个.. 由于提前
作为最佳实践,不存储,可以计算出的属性/导出 – rags
我没有得到ü.. – rtvalluri
不要存储列的总成本,因为它可以从其他两列,数量和costperunit派生出来 – rags