gpt4 book ai didi

mysql - 简单的 date_sub() mySQL 查询无法执行

转载 作者:行者123 更新时间:2023-11-29 08:00:57 25 4
gpt4 key购买 nike

这是我尝试执行但无济于事的查询

SELECT 
p.*, c.*
FROM
`players` AS `p`
INNER JOIN
`price_checks` AS `c`
ON
`c`.`resourceId` = `p`.`Player_Resource`
WHERE
DATE(`c`.`timecheck`) = DATE(DATE_SUB(NOW(), INTERVAL 1 DAY)
AND
`p`.`Players_id` = '16892'

我所看到的错误如下

SELECT p.*, c.* FROM `players` AS `p` INNER JOIN `price_checks` AS `c` ON `c`.`resourceId` = `p`.`Player_Resource` WHERE DATE(`c`.`timecheck`) = DATE(DATE_SUB(NOW() , INTERVAL 1 DAY) AND `p`.`Players_id` = '16892' 
LIMIT 0, 25
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 'LIMIT 0, 25' at line 2

它是说我要附加 LIMIT 语法?有什么原因可能会失败吗?

最佳答案

您缺少)

     DATE(`c`.`timecheck`) = DATE(DATE_SUB(NOW(), INTERVAL 1 DAY) )
^--here

原因: mysql正在寻找),然后它出现了LIMIT,而)还没有出现,所以他很惊讶为什么 LIMIT 现在出现:),然后它告诉你 ayyy,Heyy! LIMIT 右边是否缺少某些内容:)。 ?

关于mysql - 简单的 date_sub() mySQL 查询无法执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23845331/

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