我有一个表,其中有一列名为“来自”。我想从中检索数据,所以我尝试了以下查询。
select title,from,grade from localcourses where title='new';
但是由于列名“来自”,我得到以下异常。
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 'from,grade from localcourses where title='new'
如何在不重命名列名的情况下避免这种情况?谢谢。
最佳答案
尝试——
select `title`,`from`,`grade` from localcourses where `title`='new';
关于mysql - 列名为 'from' 的 SQL 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7311990/