首页 > 数据库技术 > 详细

mysql中容易忽略的问题

时间:2015-12-23 10:35:09      阅读:138      评论:0      收藏:0      [点我收藏+]

1. null是不可比较的(跟java中的NaN类似),因此其比较操作总是false比如:

update table set channel = #channel# where order_id = 12345  and channel <> ‘AA‘  (如果channel为null,则channel<>‘AA‘也总是不成立的)

 

2. count distinct的bug:select count(distinct three_part_extend) from table_order where three_part_extend is not null and three_part_extend<>‘{}‘

具体见:http://dinglin.iteye.com/blog/1976026  http://dinglin.iteye.com/blog/1982176

 

mysql中容易忽略的问题

原文:http://www.cnblogs.com/xinglongbing/p/5068897.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!