我想用一个例子来说明db2 update的使用aa(id,qty) ,bb(id,qty,loc_id(货架号))两个表.目的是把aa.qty=bb.qty db2 update aa set qty=(select qty from bb where bb.id=aa.id and bb.loc_id=9) where exists (select 1 from bb where bb.id=aa.id and bb.loc_id=9)
使用select ..........where............. limit 1
试吧
只返回一条记录
添加新评论0 条评论