首页 > 解决方案 > 使用 Bigquery 查找未嵌套的值

问题描述

我有两个表,其中表 1 包含两列:一列包含嵌入在字符串值中的 URL 列表(每个单元格包含多个 URL),以及一个日期列。我设法将所有未嵌套的 URL 提取到表 2。我需要查看这两个表以获取每个抓取的 URL 的日期(如表 3 所示)

  Table 1    string | Date
              ______________
             STRING 1    Date 1     
             STRING 2    Date 2         
             STRING 3    Date 3  

  Table 2    Scraped URL |  string
             ______________________
             scraped URL 1  STRING 1
             scraped URL 2  STRING 2 
             scraped URL 3  STRING 3

  Table 3   scraped URL | Date
            _________________________
           scraped URL 1  Date 1
           scraped URL 2  Date 2
           scraped URL 3  Date 3

标签: sqlgoogle-bigquery

解决方案


你在找一个join吗?

select t2.scraped_url, t1.date
from table1 t1 join
     table2 t2
     on t2.scraped_url = t1.url

推荐阅读