1.首先建表
-- Create table create table T_TEST ( org_no VARCHAR2(16) not null, org_type VARCHAR2(16) ) -- Create/Recreate indexes create unique index PK_T_TEST on T_TEST (ORG_NO);
2.向该表中插入数据
3.运行sql
select * from t_test t where t.org_type is null
4.运行,预期结果应该为3条
select * from t_test t where t.org_type <> '01'
结论:NULL是数据库中特有的数据类型,当一条记录的某个列为NULL,则表示这个列的值是未知的、是不确定的。既然是未知的,就有无数种的可能性。因此,NULL并不是一个确定的值。
hive中的null类似