Angela
Angela

Reputation: 43

Trying to fill in blank rows with the values from a non blank row in bigquery

I have split a column (Column E) to multiple rows however the other columns (A-D)get displayed only once for every row split as shown in screenshot. I want to fill in the blank rows (highlighted in yellow) with the values from the above row. enter image description here

This is the query I am using currently:

select A,B,C,D,split(E,'|') E
from 
(
select A,B,C,D,E
   from Table  
) 

Upvotes: 0

Views: 525

Answers (1)

Mikhail Berlyant
Mikhail Berlyant

Reputation: 172993

Below is for BigQuery Standard SQL

#standardSQL
SELECT A,B,C,D,E
FROM `project.dataset.table`,
UNNEST(SPLIT(E,'|')) E

Upvotes: 2

Related Questions