BigQuery Coalesce

In order to get the return of the first non-NULL value in the expression one can use the COALESCE function in BigQuery.

The input expressions can be of any type such as STRING, DATETIME, etc. but they must be consistent in data type so that the result of which of the expressions/variables used in the coalesce function are of the same type, also known as a Super Type.

BigQuery Coalesce Explained

In general a SELECT statement can list columns, call functions against one or more columns, etc. So if you are looking to find the first non-null value of any column or expressions, then coalesce functions to do that for you programatically. For example if in the following SQL statement Col1 is null, but Col2 has a value it will return the value of Col2 as the aliased column colValNeeded:

SELECT COALESCE(col1, col2, 'N/A') as colValNeeded FROM tableA;