ORACLE修改与新增
作者:互联网
ORACLE修改与新增
static final String SQLUPDATEGOODS ="merge into b_supplier_shopping_cart t using dual on (t.supplier_no=? and t.goods_no=?) "
+" when not matched then insert (supplier_no,goods_no,goods_buy_num,goods_box_price,create_account,modify_account,create_date,modify_date,goods_all_price) values (?,?,?,?,?,?,?,?,?) "
+" when matched then update set goods_buy_num = ?,goods_all_price=? ";
dual on 后边跟条件多个条件用and连接.当不满足条件也就是when not matched执行的是insert否则就是update(将要修改的字段写进来)。
标签:goods,no,新增,price,when,修改,ORACLE,supplier,matched 来源: https://blog.csdn.net/Waiting_lcy/article/details/112132058