Hi All...,
Here is the equivalent function for Oracle's Median in SQL Server..
Here is the equivalent function for Oracle's Median in SQL Server..
Oracle
|
SQL Server
|
select deptno,median(sal) from emp group by deptno
|
select * from
(select distinct e.deptno, PERCENTILE_CONT(0.5)
within group(order by e.sal) over(partition by e.deptno)
as median_sal from emp e)
as a
where a.deptno is not null
|