当前位置:网站首页>Oracle一条语句实现更新or新增
Oracle一条语句实现更新or新增
2022-07-20 21:19:00 【头真的好重好重Y】
如果表中有这条数据,那么就更新,如果没有那么就新增。
-- SQL%NOTFOUND 是一个布尔值。与最近的sql语句(update, insert, delete, select)会发生交互,当最近的一条sql语句没有涉及任何行(返回值为0)的时候,则返回true,否则返回false。
BEGIN
UPDATE USER
SET USER.PASSWORD = '123456' WHERE USER.USERNAME = 'admin' AND USER.SEX = '1';
IF SQL%NOTFOUND THEN
INSERT INTO USER(RECORDID, USERNAME, PASSWORD, SEX)
VALUES (GET_UUID(), 'admin', '123456', '1');
END IF;
END;
边栏推荐
- On the surface, the meta universe may fundamentally change people's way of production and life
- 【MQTT从入门到提高系列 | 08】MQTT3.1.1主题Topic详解
- Devaxpress xtrareport report development related knowledge points
- 企业需要建立属于自己的小程序及APP需要做什么前期工作?
- TL494电源芯片使用记录分享
- (open shortest path first, OSPF) comprehensive experiment
- How static code analysis works
- 买了一台云服务器到底能干什么?到底有哪些新玩法?
- 第二章 第四节:替换和切割
- ESP8266-NodeMCU——使用U8g2库点亮OLED
猜你喜欢
BGP (border gateway protocol) border gateway protocol
算法总结] 20 道题搞定 BAT 面试——二叉树
编程-常识cs
[case sharing] typical configuration of policy routing
8 月亚马逊云科技培训与认证课程,精彩不容错过!
04 提取最新的数据
TL494电源芯片使用记录分享
Php talent Recruitment site source
[报错]RuntimeError: expected scalar type Double but found Float(torch)
Fuxin software appeared at the 2022 national chemical enterprise digital intelligence transformation and Development Forum
随机推荐
Web application vulnerability -x-forwarded-for injection
std::string 不能跨dll的一种解决方法
Fuxin software appeared at the 2022 national chemical enterprise digital intelligence transformation and Development Forum
Section 12 of Chapter 2: set set
Is CICC securities a regular securities company? Is it safe to open a stock account?
编程-常识cs
C interface with SAP
经典赛题-Web渗透测试记录
asp.net -GridView自带的删除行项超链接用法(DeleteButton)
How static code analysis works
net core 3.1使用identityServer登录时signin-oidc报Correlation failed的解决方法
Can physical layer introduction
VIM basic skills
04 extract the latest data
深入理解完美哈希
2021年山东省职业院校技能大赛中职组”网络安全“正式赛题
On the surface, the meta universe may fundamentally change people's way of production and life
PHP人才招聘网站源码
Vulnhub靶机-doubletrouble
第二章 第四节:替换和切割