【问题标题】:SQL: Filter based on criteriaSQL:根据条件过滤
【发布时间】:2014-10-01 17:55:59
【问题描述】:

我正在使用 Yahoo 的 YQL 检索有关我的 Fantasy Football 联赛的数据。 YQL 与 SQL 非常相似。

Here 是 `

的输出
select * 
from fantasysports.leagues.standings 
where league_key='331.l.777399'

如果我提供 team_id,我将如何过滤它以仅显示团队的“points_for”

我以为是

select * 
from fantasysports.leagues.standings 
where league_key='331.l.777399' 
and standings.teams.team.%.team_id='2'

但这没有用。

【问题讨论】:

    标签: sql yql


    【解决方案1】:

    你可以试试这样的

    select points_for
    from fantasysports.leagues.standings
    where league_key='331.l.777399'
    and standings.teams.team.%.team_id='2'
    

    【讨论】:

    • 下次不要把一行代码写到足以容纳 Jumbo 的跑道。
    • 不不,在我使用的代码中,即使我这样做standings.teams.team.%.team_id='2',它也没有提供任何东西
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-06-08
    • 2018-10-08
    • 1970-01-01
    • 2019-10-23
    • 2018-11-25
    • 1970-01-01
    相关资源
    最近更新 更多