一、库存表:商品ID、库存量; 入库表:商品ID、入库时间(以天为单位)、入库量。
如何把每天的入库量更新到库存量里?
update stock a set (a.count) = (select a.count+b.incount from instock b where a.id = b.id)
一、库存表:商品ID、库存量; 入库表:商品ID、入库时间(以天为单位)、入库量。
如何把每天的入库量更新到库存量里?
update stock a set (a.count) = (select a.count+b.incount from instock b where a.id = b.id)
转载于:https://my.oschina.net/u/1413786/blog/219631