【问题标题】:YQL - What is syntax to query data for the past 3 months in YQL?YQL - 在 YQL 中查询过去 3 个月的数据的语法是什么?
【发布时间】:2016-04-06 18:56:06
【问题描述】:

我有这个查询,我想更改它,以便它获取过去 3 个月(或从现在起 90 天)的数据。

select * from yahoo.finance.historicaldata where symbol = "YHOO" and startDate = "2009-09-11" and endDate = "2010-03-10"

YQL 中是否有任何“回溯”功能?

【问题讨论】:

  • 有什么问题?
  • 嗨@WhoAmI 感谢您的回复,问题是我想修改我的查询,以便它符合过去 3 个月的数据(例如获取 3 个月后的历史数据)。
  • 抱歉回复晚了。你在哪里使用 YQL 查询?我的意思是,你是在像 jQuery 还是 python 或 php 一样使用它?
  • 嗨 @WhoAmI 我在 Android 上使用它

标签: sql yql yahoo-api yahoo-finance


【解决方案1】:

如果您想使用 YQL,我建议您使用 YQL 开发者控制台(启用社区表)

这里:https://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys

以下 YQL 语句将获取 Yahoo 从年初到昨天的历史数据:

select * from yahoo.finance.historicaldata where symbol = "YHOO" and startDate = "2016-01-01" and endDate = "2016-03-24"

此 URL 将生成以下 JSON 响应:

https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.historicaldata%20where%20symbol%20%3D%20%22YHOO%22%20and%20startDate%20%3D%20%222016-01-01%22%20and%20endDate%20%3D%20%222016-03-24%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多