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