gpt4 book ai didi

mysql 多重删除错误

转载 作者:行者123 更新时间:2023-11-29 12:50:04 24 4
gpt4 key购买 nike

我有mysql查询

DELETE data 
FROM table
WHERE DATE_SUB(NOW(), INTERVAL 1 DAY)
AND status <> 0;

我收到此错误:

ERROR 1109 (42S02) at line 2: Unknown table 'date' in MULTI DELETE

如何解决这个问题?

最佳答案

data 未定义。您可以使用别名或将其完全删除:

DELETE t 
FROM table t
WHERE DATE_SUB(NOW(), INTERVAL 1 DAY) AND status <> 0;

或者尝试一下:

DELETE FROM data
WHERE DATE_SUB(NOW(), INTERVAL 1 DAY) AND status <> 0;

关于mysql 多重删除错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24887143/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com