SQL where 子句中的未知列

SQL unknown column in where clause

我收到这个错误:

Error: UPDATE stats SET stat2='2' WHERE name=views
Unknown column 'views' in 'where clause'

在 table 中 'name' 是列,'views' 是该列中的一个值。

据我从文档中得知,语句“WHERE name=views”应读作“WHERE {column}={cell value}”,而错误是推断列名是第二个值。

您需要将值放在 '' 中,因为它是一个字符串值

UPDATE stats SET stat2='2' WHERE name='views'