MySQL注意点

Posted Trace Spaces

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL注意点相关的知识,希望对你有一定的参考价值。

以下针对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注意点的主要内容,如果未能解决你的问题,请参考以下文章

mysql 注意点

Mysql 特别注意点!

Mysql 特别注意点!

MYSQL,year类型的使用与注意点!

mysql主从切换维护时的几点注意

Mysql整数运算NULL值处理注意点