Bigquery select distinct values

前端 未结 6 949
离开以前
离开以前 2021-01-11 10:03

How to select distinct values in Google Bigquery?

Query:

SELECT DISTINCT cc_info
FROM user
WHERE date = ?

Thanks!

6条回答
  •  没有蜡笔的小新
    2021-01-11 11:00

    This is another way to achieve your goal (in case anyone else needs it) which works in the current BigQuery 2020.

    SELECT colname FROM table1
    UNION DISTINCT 
    SELECT colname FROM table2
    UNION DISTINCT
    .
    .
    .
    SELECT colname FROM tableN 
    

    My reference was this article.

提交回复
热议问题