Using a single statement - One way is to use ROW_NUMBER(), COUNT() window function and filter usingthe sub-query. Here is to find the median salary:
SELECT AVG(a.Salarye_salary)
FROM
(SELECT
ROW_NUMBER() OVER(ORDER BY Salarye_salary) as row_no, Salary
FROM Employee)a
CROSS JOIN e_salary,
(SELECT (COUNT(*) OVER()+1)*0.5 AS row_half
FROM Employee ) t
WHERE a.row_no IN (FLOOR(t.row_half),CEILING(t.row_half))
I have seen similar solutions over the net using FLOOR and CEILING but tried to use a single statement. (edited)