【发布时间】:2021-05-31 14:41:55
【问题描述】:
我正在使用Google Patents Public Dataset提取有关使用CPC代码“A01N”保存人体或动物或其植物或其部分的农药的专利信息
但是当我运行以下查询时,我并没有像运行非嵌套查询那样获得所有结果。见下文
SELECT patents.country_code, count(DISTINCT publication_number) as quantity
FROM
`patents-public-data.patents.publications` AS patents,
UNNEST(title_localized) AS title,
UNNEST(abstract_localized) AS abstract,
UNNEST(cpc) AS cpc_code,
UNNEST(inventor_harmonized) AS inventor,
UNNEST(assignee_harmonized) AS assignee
WHERE
cpc_code.code LIKE '%A01N%'
GROUP BY patents.country_code
ORDER BY quantity DESC
| Row | country_code | quantity |
|---|---|---|
| 1 | US | 67280 |
| 2 | CN | 59067 |
| 3 | WO | 39560 |
| 4 | EP | 37886 |
| 5 | CA | 23115 |
SELECT patents.country_code, count(DISTINCT publication_number) as quantity
FROM
`patents-public-data.patents.publications` AS patents,
UNNEST(cpc) AS cpc_code
WHERE
cpc_code.code LIKE '%A01N%'
GROUP BY country_code
ORDER BY quantity DESC
| Row | country_code | quantity |
|---|---|---|
| 1 | US | 77056 |
| 2 | CN | 70654 |
| 3 | EP | 60291 |
| 4 | WO | 39624 |
| 5 | JP | 36135 |
我不明白为什么两个结果之间存在差异,因为没有应用更多过滤器?
当我 UNNEST 更多列时,如何维护所有行?
【问题讨论】:
标签: mysql google-bigquery record