使用下面的代码查询正向引用的计数,但是没有用

时间:2018-12-09 08:46:19

标签: sql google-bigquery google-patent-search

我使用下面的代码查询正向引用的计数,但是没有用。independent-tea-223707:Mypatent.publication_num_assignee是我自己创建的表。

 SELECT c.publication_number AS Pub, COUNT(p.publication_number) AS
    CitedBy 
    FROM `patents-public-data.patents.publications` AS p, UNNEST(citation) AS c 
    WHERE c.publication_number IN  (SELECT publication_number FROM `independent-tea-223707:Mypatent.publication_num_assignee`)

1 个答案:

答案 0 :(得分:0)

此查询缺少一个GROUP BY() statement,因为您正在使用一个聚合函数COUNT()将结果按多个列进行分组。

对于任何其他建议,此问题需要重新表述并提供理解该问题所必需的所有要素(例如citation对象的结构和内容,错误消息等)。在此处查看有关how to ask a good question的建议。

同时,我邀请您查看the standard SQL syntax for BigQuery,您可能希望特别关注the UNNEST statement