数据库面试题

一、库存表:商品ID、库存量; 入库表:商品ID、入库时间(以天为单位)、入库量。

      如何把每天的入库量更新到库存量里?

      update stock a set (a.count) = (select a.count+b.incount from instock b where a.id = b.id)


你可能感兴趣的:(数据库面试题)