Oracle: how to UPSERT (update or insert into a table?)

后端 未结 12 1406
南旧
南旧 2020-11-22 07:18

The UPSERT operation either updates or inserts a row in a table, depending if the table already has a row that matches the data:

if table t has a row exists          


        
12条回答
  •  难免孤独
    2020-11-22 08:13

    Try this,

    insert into b_building_property (
      select
        'AREA_IN_COMMON_USE_DOUBLE','Area in Common Use','DOUBLE', null, 9000, 9
      from dual
    )
    minus
    (
      select * from b_building_property where id = 9
    )
    ;
    

提交回复
热议问题