警惕 in (null)

  
  select schedulerid from circuit where schedulerid not in (null);

查询结果:

|SCHEDULERID|
+----------------------+


结论:任何与null的比较(<,>,=,>=,<=,between and )和 in,not in等等的结果都是false。
心得:养成对select,insert,where子句使用nvl的习惯。警惕子查询的结果中是否有null值。

猜你喜欢

转载自623deyingxiong.iteye.com/blog/1631281