Home > Software design >  How to use PERCENTILE_CONT without over clause? any alternative to it?
How to use PERCENTILE_CONT without over clause? any alternative to it?

Time:10-02

I am interested in finding median of an entire column in SQL Server and I don't want to partition/subset column based on some other attribute. I am looking for a way to use PERCENTILE_CONT without over or any other function to find median. I have tried

over(my_table)
OVER (PARTITION BY NULL)
OVER ( NULL)

CodePudding user response:

As noted by @Fakhar the syntax for MS SQL is slightly different.

PERCENTILE_CONT(0.5) OVER()

For BigQuery SQL

PERCENTILE_CONT(your_field, 0.5) OVER()
  • Related