merge into 用法
来源:互联网 发布:对美工电商有什么了解 编辑:程序博客网 时间:2024/05/17 08:42
使用例子
merge into user_role ausing ( select t1.*,t2.belongorg,to_char(sysdate, 'yyyy/mm/dd hh24:mm:ss') as curtime,'taj' as curuser from (select t1.roleid,'add' as operation,'test1' as userid from awe_role_info t1 where t1.roleid in('3107','3109','3450') union all select t1.roleid,'del' as operation,'test1' as userid from awe_role_info t1 where t1.roleid in('3110','3111','3201','3400') ) t1 join user_info t2 on t2.userid=t1.userid) b on (a.userid=b.userid and a.roleid=b.roleid)when matched then update set a.grantor=a.grantor where b.operation = 'del' delete where b.operation = 'del'when not matched then insert(userid,roleid,grantor,begintime,status,inputuser,inputorg,inputtime) values(b.userid,b.roleid,b.curuser,b.curtime,'1',b.curuser,b.belongorg,b.curtime) where b.operation = 'add';
0 0
- merge into用法
- merge into的用法
- Merge Into 用法【转】
- Merge Into 用法【转】
- MERGE INTO 用法
- merge into 的用法
- merge into 用法小结
- MERGE INTO 用法
- oracle merge into用法
- merge into 用法
- merge into的用法
- MERGE INTO用法
- oracle merge into 用法
- ORACLE MERGE INTO用法
- MERGE INTO用法
- merge into用法
- ORACLE: MERGE INTO用法
- merge into 语句用法
- Jackson 动态过滤属性
- poj 1691
- js实现换肤
- 使用JSoup+CSSPath采集和讯网人物信息
- Eclipse抽疯治愈大招
- merge into 用法
- Mysql 重设丢失的root密码
- Spring Boot使用redis做数据缓存
- 常用函数总结
- jdbc代码抽取
- 个推推送iOS版 常见问题详解
- JavaScript的正则表达式
- unity3d 导出NGUI图集中的图片
- 把Java程序打包成jar文件包并执行