Last active
April 2, 2019 18:33
-
-
Save molavec/c462d23074d28ae2cd32730095484867 to your computer and use it in GitHub Desktop.
[bigquery - campo dentro de un arreglo struct] ejemplo para la consulta de un campo en dentro de una estructura #bigquery #sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT av.action_type, av.value | |
FROM | |
`[RUTA_PROYECTO].[RUTA_CONJUNTO_DE_DATOS].ads_insights`, unnest(actions) a, unnest(action_values) av | |
WHERE | |
av.action_type Like '%purchase%' | |
LIMIT 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE VIEW `[RUTA_PROYECTO].[RUTA_CONJUNTO_DE_DATOS].convertion_type_view` AS | |
SELECT DISTINCT | |
a.action_type | |
FROM | |
`[RUTA_PROYECTO].[RUTA_CONJUNTO_DE_DATOS].ads_insights`, UNNEST(actions) AS a | |
WHERE | |
a.action_type Like '%lead%' OR a.action_type Like '%purchase%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment