码迷,mamicode.com
首页 > 数据库 > 详细

MySQL注意点

时间:2017-12-29 15:27:12      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:sed   which   .com   item   记录   when   blog   can   void   

以下针对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注意点

标签:sed   which   .com   item   记录   when   blog   can   void   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!