Google BigQuery - github时间轴表中的奇怪查询错误

问题描述 投票:0回答:1

我在Google Big Query服务中执行了一个查询,误解了错误

错误:表'evt'中找不到字段'evt.repository_name'。

,因为该字段存在于指向错误的表中。有人可以帮我解决这个问题吗?

查询:

    select nname 
    from (
         select evt.repository_name nname, count(evt.payload_issue_id) issues_count
         from [publicdata:samples.github_timeline] evt 
           where upper(repository_language)='JAVA'
          AND evt.repository_name in (
              select name from (

                     select evt1.repository_name name, count(evt1.payload_commit_id) commits_count
                     from [publicdata:samples.github_timeline] evt1 
                     where upper(repository_language)='JAVA'
                     group by name
                     order by commits_count desc 
                     limit 20  
                               ) 
             as foo2)    
    group by nname
    order by issues_count desc 
    limit 20 ) as foo
sql google-bigquery
1个回答
1
投票

这个工作:

  select nname 
    from (
         select repository_name as nname, count(payload_issue_id) as issues_count
         from [publicdata:samples.github_timeline] as evt 
           where upper(repository_language)='JAVA'
          AND repository_name in (
              select name from (

                     select evt1.repository_name name, count(evt1.payload_commit_id) commits_count
                     from [publicdata:samples.github_timeline] evt1 
                     where upper(repository_language)='JAVA'
                     group by name
                     order by commits_count desc 
                     limit 20  
                               ) 
             as foo2)    
    group by nname
    order by issues_count desc 
    limit 20 ) as foo
© www.soinside.com 2019 - 2024. All rights reserved.