UPSERT操作会更新表或在表中插入一行,这取决于表是否已经有与数据匹配的行:
if table t has a row exists that has key X: update t set mystuff... where mykey=X else insert into t mystuff...
由于Oracle没有特定的UPSERT语句,执行此操作的最佳方法是什么?