Oracle 使用MERGE INTO 语句 一条语句搞定新增编辑
MERGE INTO RDP_CHARTS_SETTING T1 USING (SELECT '10001' AS PAGE_ID, 'test' AS CHART_OPTION FROM DUAL) T2 ON (T1.PAGE_ID = T2.PAGE_ID) WHEN MATCHED THEN UPDATE SET T1.CHART_OPTION = T2.CHART_OPTION WHEN NOT MATCHED THEN INSERT (T1.PAGE_ID, T1.CHART_OPTION) VALUES (T2.PAGE_ID, T2.CHART_OPTION);
RDP_CHARTS_SETTING :表
PAGE_ID:字段1
CHART_OPTION:字段2
10001:数据1
test:数据2
本文来自博客园,作者:bigroc,转载请注明原文链接:https://www.cnblogs.com/bigroc/p/10904703.html
blog:http://www.bigroc.cn 博客园:https://www.cnblogs.com/bigroc