oracle的update语句where条件后的索引字段为空时不执行

问题描述:

update 表名 set age ='23' where id=1 and name='lili';

当在oracle执行以上sql时执行成功,但是当传入的name为null时,sql不成立。我的表中id和name是联合唯一索引,以为name不会为空,但实际上name可以为空,且为空时,不能为=,而是is,即sql为

sql 复制代码
update 表名 set age ='23' where id=1 and name is null;

而不是

sql 复制代码
update 表名 set age ='23' where id=1 and name=null;
相关推荐
djjjx.6 小时前
Mysql数据库基础篇(八):详细讲解复合查询、多表查询、自连接、多行、多列子查询与合并查询
数据库·mysql
CoderYanger10 小时前
Java EE 进阶:9.MyBatis 操作数据库(进阶)(第八弹):MyBatis Generator
java·数据库·spring boot·spring·java-ee·tomcat·mybatis
MSTcheng.11 小时前
【MySQL】MySQL数据库——表的操作
数据库·mysql·adb
Yeats_Liao12 小时前
物联网平台MongoDB实战|(一)为什么选择MongoDB
数据库·物联网·mongodb
鹤落晴春13 小时前
MySQL日志梳理
运维·数据库·mysql
五彩小白14 小时前
Redis的过期删除和内存淘汰机制
数据库·redis·缓存
学长毕设14 小时前
基于SpringBoot 博物馆文物租赁及修复管理系统-附源码
大数据·数据库·spring boot
apcipot_rain14 小时前
C++转Java日记(14)
数据库
龙腾AI白云17 小时前
数字孪生与计算机视觉:让机器看懂现场
大数据·数据库·机器学习·知识图谱·pygame
千寻技术帮18 小时前
基于Spring Boot+Vue的农产品销售管理系统(源码+文档+数据库,附部署教程)
java·数据库·spring boot·后端·mysql·vue