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

mysql数据库字段命名与关键字冲突之坑

时间:2014-07-25 13:52:11      阅读:333      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   color   数据   io   for   re   

 

mysql> SELECT desc,status,play_time,push_type, interval FROM cms_push;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 700
Current database: xxx_cms

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near desc,status,play_time,push_type, interval FROM cms_push at line 1

问题很简单,desc和interval是关键字,需要加上引号,以后起名要注意了

mysql> SELECT desc,status,play_time,push_type,interval FROM cms_push;

mysql数据库字段命名与关键字冲突之坑,布布扣,bubuko.com

mysql数据库字段命名与关键字冲突之坑

标签:des   style   blog   color   数据   io   for   re   

原文地址:http://www.cnblogs.com/iwangzheng/p/3867659.html

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