big query get distinct array of objects
SELECT * REPLACE(
dedup(country) AS country,
dedup(product) AS product
)
FROM `project.dataset.table`
big query get distinct array of objects
SELECT * REPLACE(
dedup(country) AS country,
dedup(product) AS product
)
FROM `project.dataset.table`
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
));
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us