oracle查询语句注意事项:

我想查出datatype 不等于1的所有结果,包括空。

select * from user where datatype <> '1'; //这条sql查不出datatype为空的数据
 

 发现oracle需要使用  is  null  、is  not null查询空或非空

select * from user where datatype <> '1' or datatype  is null;//这样就能查出datatype不等于1的所有结果

------------------------------------------------------------------------------------------------------------------------------------

猜你喜欢

转载自www.cnblogs.com/Alwaysbecoding/p/9488447.html