How to convert Array of columns to rows in Bigquery
I have a column as below screenshot in my google bigquery
\n\ni need to convert that column to rows as below in Bigquery :
\n\n70042\n70055\n70044\n70046\n70042\n70055\n70044\n70046
\n\n#standardSQL\nSELECT id, dspid\nFROM `veuhub-185502.AdtechAnalytics.tag_request`,\nUNNEST(dspid) dspid \n
\n\nor below for (based on your comments)
\n\n#standardSQL\nSELECT \n DSPID, \n adtype, \n adtypeWithDevice, \n EXTRACT(year FROM request_timestamp) AS year, \n EXTRACT(month FROM request_timestamp) AS month, \n EXTRACT(day FROM request_timestamp) AS day, \n EXTRACT(hour FROM request_timestamp) AS hour, \n SUM(1) AS requestcount \nFROM `veuhub-185502.AdtechAnalytics.tag_request`, \nUNNEST(dspid) dspid \nGROUP BY adtype,adTypeWithDevice,DSPID,year,month,day,hour\n
victor
posted onEnjoy great content like this and a lot more !
Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds