MySQL错误:ERROR 1064 (42000): use near 'order’解决

环境

MySQL Sever 5.1 + MySQL命令行工具

问题

ERROR 1064 (42000): You have an error inyour SQL syntax; check the manual that orresponds to your MySQL server versionfor the right syntax to use near 'order’


MySQL错误:ERROR 1064 (42000): use near 'order’解决


解决

表名使用了关键字,数据库中命名要避免使用关键字。Hibernate中查询语句为字段起别名,目的就是避免使用关键字。

参考资料

http://hi.baidu.com/yuiezt/item/fb563d6b4445b3156995e668

http://www.examw.com/biancheng/mysql/165562/