导读 昨天有个群友问: select x from table where varchar = 0; (未加引号)能把所有数据查询出来, 问是否是BUG. 对于数据类型不一致的做比较, 就是mysql帮我们做了隐式转换. 隐式转换规则如下: If one or both arguments are NULL, the result of the comparison is NULL, except
背景: 因为之前处理了一些关于not exsts导致的性能sql,但是没时间整理,最近打算抽时间分享一下。 验证案例: sql文本如下,因为篇幅有限,而且不太需要,所以我就不放建表语句及数据量的信息了 select count(1) from tttt.mmmmm_sssssale t where t.sssss not in ('e111', 'ddddda') and t.stats = '1