SELECT * FROM `t` WHERE chatId='a15' and from='a13' ORDER BY id DESC LIMIT 10
特么的今天在写一个sql语句的时候遇到个坑,就是from是mysql的关键字!上面sql语句的会报错,必须要像下面这样
SELECT * FROM `t` WHERE chatId='a15' and t.from='a13' ORDER BY id DESC LIMIT 10
SELECT * FROM `t` WHERE chatId='a15' and from='a13' ORDER BY id DESC LIMIT 10
特么的今天在写一个sql语句的时候遇到个坑,就是from是mysql的关键字!上面sql语句的会报错,必须要像下面这样
SELECT * FROM `t` WHERE chatId='a15' and t.from='a13' ORDER BY id DESC LIMIT 10