update  取值问题

  如果 有两个 字段 a,b 并且 初始 a=0,b=0

  update set a=100,b=a+1 的结果是 a=100,b=101
  update set b=a+1,a=100 的结果是 b=1,a=100

  测试于 mysql 8.0.25 ,和 5.6.43

 

 

not in ,!= 不会查询出 空值

  如果 有三条数据,字段 a 的值分别是 1,2,null

  where a != 1 和 where a not in (1) 都只能查询到 2 这一条,不会查询出 null 的那一条(只有有数据才能放到索引树里面去)