zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

Oracle中“不等于”的使用

Oracle 等于 使用
2023-09-11 14:22:43 时间

在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 后面