Oracle中“不等于”的使用

时间:2020-09-15 21:31:36   收藏:0   阅读:83

在oracle中判断字段id不是“123”时,

select * from user where id<> ‘123‘; 但是id为空的,却怎么也查询不出来。

原因是:字段为null的时候,只能通过is null或者is not null来判断。

这样写才是正确的: select * from user where id <> ‘123‘ or id is null;

Left join的on后条件不起作用的原因

on 后面的条件只能起链接俩个表的作用,不能作为过滤条件使用,过滤条件只能加在where 后面

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!