首页 > 代码库 > SQL 专题实验

SQL 专题实验

merge

merge into copy_emp ce using emp e
on (ce.empno = e.empno)
when matched then
     update set
     ename = e.ename
when not matched then
     insert (empno, ename)
     values(e.empno, e.ename)
<style></style>

注: merge 也属于 dml 操作, 所以操作之后需要进行 commit;

escape 转义字符

SELECT * FROM copy_emp
where ename like ‘XAA\_%‘ ESCAPE ‘\‘
<style></style>