首页 > 数据库技术 > 详细

MySQL注意点

时间:2017-12-29 14:06:52      阅读:218      评论:0      收藏:0      [点我收藏+]

以下针对MySQL5.7(持续更新中):

 

  1. Use of an unqualified * with other items in the select list may produce a parse error. To avoid this problem, use a qualified tbl_name.* reference
  2. It is not permissible to refer to a column alias in a WHERE clause, because the column value might not yet be determined when the WHERE clause is executed
  3. Remove leading and/or trailing spaces: UPDATE tbl_name SET col=trim(col)
  4. If you do not use columns from all tables named in a query, MySQL stops scanning any unused tables as soon as it finds the first match. In the following case, assuming that t1 is used before t2 (which you can check with EXPLAIN), MySQL stops reading from t2 (for any particular row in t1) when it finds the first row in t2:
    SELECT DISTINCT t1.a FROM t1, t2 where t1.a=t2.a;
  5. MySQL UPDATE Statement 字段值没有不同,不会更新记录

MySQL注意点

原文:https://www.cnblogs.com/huangzejun/p/8143477.html

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