Skip to content
Advertisement

Is there a more efficient way to write code for bin values in Databricks SQL?

I am using Databricks SQL, and want to understand if I can make my code lighter:

JavaScript

Instead of writing each line, is there a cool way to state that all of these columns starting with “age_” need to be null in 1 or 2 lines of code?

Advertisement

Answer

If each bin is a column then you probably are going to have to spell it out, but you could use coalesce:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement