2

如果我select在我的 PhpMyAdmin(版本 4.0.5)上运行这个查询:

(SELECT *
FROM prenotazione
WHERE stato = 'prenotato'
AND (to_days( data ) +2) < to_days( NOW( ) )
)

运行良好。

但是,如果我运行一个delete不起作用的查询:

(DELETE *
FROM prenotazione
WHERE stato = 'prenotato'
AND (to_days( data ) +2) < to_days( NOW( ) )
)

有人请解释一下,为什么会这样。

4

3 回答 3

4

只是

DELETE FROM ...

不是

DELETE * FROM ...
      ^^^

有关详细信息,请参阅DELETE 语法

于 2013-10-23T13:37:40.327 回答
1

像这样进行查询:

(DELETE FROM prenotazione WHERE stato = 'prenotato' AND (to_days( data ) +2) < to_days( NOW( ) ) )

有关更多信息,请查看删除语法手册

于 2013-10-23T13:40:08.437 回答
0

这项工作在查询前后没有 * 和括号

DELETE
FROM prenotazione
WHERE stato = 'prenotato'
AND (to_days( data ) +2) < to_days( NOW( ) )
于 2013-10-23T21:10:29.753 回答