首页 > 解决方案 > BigQuery 调整表以消除具有两个相互依赖的行的重复项

问题描述

表格有两个维度,我想根据两个维度清除重复项,以便调整后只剩下一对。我相信它应该是基本的,因为我是新手,也许有人可以指出我正确的方向?

select id, label 
from table1

unique_id         label   
        1          fast
        1     streaming
        1          fast
        2         issue
        2          fast
        2         other
        3         other
        3         other
        3         other

我想收到这样的表:

unique_id         label   
        1          fast
        1     streaming
        2         issue
        2          fast
        2         other
        3         other

标签: sqlgoogle-bigquery

解决方案


您可以使用select distinct

select distinct id, label 
from table1;

推荐阅读