gpt4 book ai didi

mysql - 从查询中消除每个符号的前 14 个

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

以下查询提取relative_strength_index 表中不存在的所有行。但我还需要根据历史数据表中的日期升序消除每个交易品种的前 14 行。我曾多次尝试这样做,但我在这 14 天里遇到了真正的麻烦。如何解决此问题并将其添加到我当前的查询中?

当前查询

select *
from historical_data hd
where not exists (select rsi_symbol, rsi_date from relative_strength_index where hd.symbol = rsi_symbol and hd.histDate = rsi_date);

最佳答案

您想要的是限制子句的第一个参数。其中指定从哪一行开始并附有 asc 顺序。

select * from historical_data hd where not exists (select rsi_symbol, rsi_date from relative_strength_index where hd.symbol = rsi_symbol and hd.histDate = rsi_date ORDER BY rsi_date ASC LIMIT 14)

关于mysql - 从查询中消除每个符号的前 14 个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36816063/

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