为什么这个删除查询会给我一个语法错误?

pod7payv  于 2021-06-17  发布在  Mysql
关注(0)|答案(2)|浏览(534)

我试图从一个表中删除行,但不断得到一个语法错误,我不知道为什么。
我的问题是: DELETE * FROM questions WHERE catid = '680' 这是我的表格结构:

id (primary key, auto increment)
question
catid
ordering

通过上述查询,我得到以下错误:

There was an error running the query [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 questions WHERE catid = "680"' at line 1]

表中有两行,一行catid=680和679。

qfe3c7zg

qfe3c7zg1#

试试下面-

DELETE FROM questions 
  WHERE catid = 680
px9o7tmv

px9o7tmv2#

应该是的

DELETE FROM questions WHERE catid = '680'

相关问题