mysql的查询last_value报错
2021-12-16 本文已影响0人
尘埃里的玄
SQL 错误 [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 'from meter m
这个错误非常常见
image.png
sql也是巨简单的sql的
image.png
然后我仔细一看,为啥字段名是红色的,一查,原来last_value是一个mysql的内置函数,
真心用orm用多了,很少用mysql的函数了,这些函数名更加不常见,我建议mysql在建表的时候就应该用了与mysql的内置关键字重名的名字直接报错,