oracle 中的null与''
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了oracle 中的null与'',小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3639字,纯文字阅读大概需要6分钟。
内容图文
![oracle 中的null与''](/upload/InfoBanner/zyjiaocheng/478/da7f46796ba344cca596081a1852b07b.jpg)
SQL> select * from test_null where nvl(name_,‘‘)=‘‘;
no rows selected
SQL> select * from test_null where nvl(name_,‘A‘)=‘A‘;
ID_ NAME_
---------- ----------
2
3
SQL>
2.关于以上现象的解释
oracle 将‘‘ 当成了null 处理。每个null都是独一无二的,对null的操作只能是 is null OR is not null,对于null的=<>,>,<的逻辑判断都会得到否。
3.看看null与‘‘在Mysql中的表现
C:\Users\zen>mysql -uzen -p Enter password: **** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.24-log MySQL Community Server (GPL) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. mysql> use product_test; Database changed mysql> drop table test_null; Query OK, 0 rows affected (0.37 sec) mysql> create table test_null(id_ int,name_ varchar(127)); Query OK, 0 rows affected (0.59 sec) mysql> insert into test_null values(1,‘oracle‘),(2,‘‘),(3,null); Query OK, 3 rows affected (0.08 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> select * from test_null; +------+--------+ | id_ | name_ | +------+--------+ | 1 | oracle | | 2 | | | 3 | NULL | +------+--------+ 3 rows in set (0.00 sec) mysql> select * from test_null where name_ is null; +------+-------+ | id_ | name_ | +------+-------+ | 3 | NULL | +------+-------+ 1 row in set (0.06 sec) mysql> select * from test_null where name_=‘‘; +------+-------+ | id_ | name_ | +------+-------+ | 2 | | +------+-------+ 1 row in set (0.00 sec) mysql> select * from test_null where name_<>‘‘; +------+--------+ | id_ | name_ | +------+--------+ | 1 | oracle | +------+--------+ 1 row in set (0.00 sec) mysql> select * from test_null where name_ is not null; +------+--------+ | id_ | name_ | +------+--------+ | 1 | oracle | | 2 | | +------+--------+ 2 rows in set (0.00 sec) mysql>
4.在mysql中null 就是null,‘‘就是空字符,没有将二者混淆起来。
oracle 中的null与''
标签:option 1.2 with sel comm monitor res pass rpo
本文系统来源:http://www.cnblogs.com/Alex-Zeng/p/6650529.html
内容总结
以上是互联网集市为您收集整理的oracle 中的null与''全部内容,希望文章能够帮你解决oracle 中的null与''所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。