YQL - 在YQL中过去3个月查询数据的语法是什么?

时间:2016-04-06 18:56:06

标签: sql yql yahoo-api yahoo-finance

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

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

有没有"回顾" YQL中有哪些功能?

1 个答案:

答案 0 :(得分:0)

如果您想使用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=