cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

how to calculate median on azure databricks delta table using sql

PadamTripathi
New Contributor II

how to calculate median on delta tables in azure databricks using sql ?

select col1, col2, col3, median(col5) from delta table group by col1, col2, col3

2 REPLIES 2

-werners-
Esteemed Contributor III

try with the percentile function, as median = percentile 50:

https://spark.apache.org/docs/latest/api/sql/#percentile

Thank you for youur comment. It worked.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now