Answers for "big query get distinct array of objects"

0

big query get distinct array of objects

SELECT * REPLACE(
  dedup(country) AS country,
  dedup(product) AS product
)
FROM `project.dataset.table`
Posted by: Guest on February-01-2022
0

big query get distinct array of objects

#Declare the function once
#standardSQL
CREATE TEMP FUNCTION dedup(val ANY TYPE) AS ((
  SELECT ARRAY_AGG(t)
  FROM (SELECT DISTINCT * FROM UNNEST(val) v) t
));
Posted by: Guest on February-01-2022

Code answers related to "big query get distinct array of objects"

Browse Popular Code Answers by Language