【问题标题】:YQL: Return single field from yahoo.finance.quotesYQL:从 yahoo.finance.quotes 返回单个字段
【发布时间】:2015-03-12 17:42:35
【问题描述】:

我刚刚开始使用 YQL,但遇到以下问题: 我不能让 YQL 从 yahoo.finance.quotes 表中返回单个值。

我只想选择“引号”中的“打开”标签

这是我正在使用的查询:

http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.historicaldata%20where%20symbol%20=%20%22AAPL%22%20and%20startDate%20=%20%222015-01-1%22%20and%20endDate%20=%20%222015-01-2%22&format=xml&diagnostics=true&env=store://datatables.org/alltableswithkeys

Execute query

我试图在官方文档中找到解决方案,但它确实按照他们解释的方式工作。 Documentation

非常感谢任何帮助!

提前谢谢你!

【问题讨论】:

    标签: xml yql yahoo-api yahoo-finance


    【解决方案1】:

    只需指定选择 "Open" 标签而不是选择 all 标签(使用星号 (*) 表示您想要所有标签)。所以这个查询:

    select Open 
    from yahoo.finance.historicaldata 
    where symbol = "AAPL" 
          and startDate = "2015-01-1" 
          and endDate = "2015-01-2"
    

    ..然后翻译成以下网址:

    http://query.yahooapis.com/v1/public/yql?q=select%20Open%20from%20yahoo.finance.historicaldata%20where%20symbol%20=%20%22AAPL%22%20and%20startDate%20=%20%222015-01-1%22%20and%20endDate%20=%20%222015-01-2%22&format=xml&diagnostics=true&env=store://datatables.org/alltableswithkeys

    ..应该做你想做的事。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多