gpt4 book ai didi

Mysql 选择条件是日期在日期集中

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

我的选择命令:

select * from wp_ved_currencies where date in (select DISTINCT date from wp_ved_currencies order by date desc limit 2);

错误消息:

Error
SQL query:Documentation


select * from wp_ved_currencies where date in (select distinct date from wp_ved_currencies order by date desc limit 2) LIMIT 0, 50
MySQL said:Documentation

#1235 - This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

你能帮我一下吗?

最佳答案

您应该能够在此处加入限制子查询:

SELECT w1.*
FROM wp_ved_currencies w1
INNER JOIN
(
SELECT DISTINCT date
FROM wp_ved_currencies
ORDER BY date DESC
LIMIT 2
) w2
ON w1.date = w2.date;

关于Mysql 选择条件是日期在日期集中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59051468/

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