Site: LeetCode
Difficulty per Site: Easy
Write a solution to calculate the difference between the highest salaries in the marketing and engineering department
. Output the absolute difference in salaries. [Full Description]
-- Submitted Solution
WITH cte AS (
SELECT
MAX(salary) FILTER (WHERE department = 'Engineering') AS engineering_sal
,MAX(salary) FILTER (WHERE department = 'Marketing') AS marketing_sal
FROM Salaries
)
SELECT
ABS(engineering_sal - marketing_sal) AS salary_difference
FROM
-- LeetCode Solution
-- None
TBD
TBD