Bigquery Clean records when value is empty

Viewed 27

I'm trying to clean the related records when type value is empty, please see below sample data:

session Type
123
456 pdp

I've written below:

select *
from table 
where Type is not null

However the "is not null" didn't clean empty record, it still returns the exact same sample table. Any suggestions how to make it right? Thanks.

2 Answers
select * from table where Type is not null or TRIM(Type) = ''

In this case, the value is not null, it is empty rather than null.

Answer my own question, can use length (Page_Type) > 0 to workaround

Related