Please help me to handle null result. I want to check a particular value is exist in bucket.
12345 - is exist
67890 - is not exist.
select raw case when res is missing then “Not Available” else “Available” end
from (select Opt1.accountNo as accountNo,ed.* from Opt1
unnest Opt1.productBundles as pb1
unnest pb1.productBundles as pb2
unnest pb2.productComponents as pc1
unnest pc1.extendedDataList as ed
where ed.value
=“12345”
LIMIT 1) AS res;
–this query return result as
[
“Available”
]
But
select raw case when res is missing then “Not Available” else “Available” end
from (select Opt1.accountNo as accountNo,ed.* from Opt1
unnest Opt1.productBundles as pb1
unnest pb1.productBundles as pb2
unnest pb2.productComponents as pc1
unnest pc1.extendedDataList as ed
where ed.value
=“67890”
LIMIT 1) AS res;
–this query result as
{
“results”:
}
How can I display that “Not available” as an output, please help me here.