cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Starting from #databricks runtime 12.2 LTS, implicit lateral column aliasing is now supported. This feature enables you to reuse an expression defined...

Hubert-Dudek
Esteemed Contributor III

Starting from #databricks runtime 12.2 LTS, implicit lateral column aliasing is now supported. This feature enables you to reuse an expression defined earlier in the same SELECT list, thus avoiding repetition of the same calculation.

For instance, in a SELECT statement with expressions like:

SELECT

'John' AS name,

'Smith' AS surname,

Concat(name, ' ', surname) AS full_name

the Concat(name, ' ', surname) can be resolved using previously defined 'John' AS name and 'Smith' AS surname.

This makes writing SQL queries easier and more efficient, as you can reference expressions that have already been defined without needing to repeat them."

ezgif-3-d3fac0139c

3 REPLIES 3

Tayyab_Vohra
Contributor

@Hubert Dudek​ , I guess this has been updated in recent update right ?

https://docs.databricks.com/release-notes/runtime/12.2.html

daniel_sahal
Esteemed Contributor

Thanks @Hubert Dudek​ for the info. Now 50% of my subselects can go to the trash 🙂

Ajay-Pandey
Esteemed Contributor III

Informative

Thanks for sharing.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.