oracle中的数值空值什么也不等。只是 is not null。

例如 table1表中有一个nub_flag 为number(1)类型的 其中已经有一部分值为1了,其他的全为空 想把其他值更新为0

写了一条语句 update table1 set nub_flag=0 where nub_flag<>1

这条语句猛一看,觉得没问题啊。但是结果更新的条数为0;其实null值是不在这个范围内的 更不在=1的范围内。

其实这个语句正确的就应为 update  table1 set nub_flag=0 where nub_flag is null;

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
猜你喜欢
  • 2022-02-27
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
相关资源
相似解决方案