java-zk-app/文档/oracle批量插入更新说明.txt

26 lines
720 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

merge into 用法:(在插入或更新,或者批量更新时,使用 merge into 写法,效率更高)
Merge into的基本语法
语法如下:
MERGE [INTO [schema .] table [t_alias]
USING [schema .] { table | view | subquery } [t_alias]
ON ( condition )
WHEN MATCHED THEN [merge_update_clause ]
WHEN NOT MATCHED THEN [merge_insert_clause];
通俗点就是如下的语法:
MERGE INTO [表名] [表别名]
USING ( [查询内容] )[或者像表查询一样的语句]
ON ([条件表达式] AND [...]...)
WHEN MATCHED THEN [匹配的update操作]
WHEN NOT MATCHED THEN [不匹配的insert操作]
参考:
https://www.cnblogs.com/onlookers/p/4270418.html
http://t.zoukankan.com/yhoralce-p-7482614.html