BEATS 96% WITH SIMPLE SOLUTION
\n# Approach\n Describe your approach to solving the problem. \nUsed if condition, if it is a negative value just try to returned the Impossible result, hence w
\n# Approach\n<!-- Describe your approach to solving the problem. -->\nUsed if condition, if it is a negative value just try to returned the Impossible result, hence will get null. For Positive flow did the code in another Block.\n\n\n# Code\n```postgresql []\nCREATE OR REPLACE FUNCTION NthHighestSalary(N INT) RETURNS TABLE (Salary INT) AS $\nBEGIN\n   IF N < 0 THEN\n        RETURN QUERY (\n        SELECT e.salary FROM Employee e WHERE e.salary = 2 AND e.salary = 1\n    );\n    END IF;\n    \n    IF N >= 1 THEN\n    RETURN QUERY (\n    SELECT DISTINCT e.salary as "getNthHighestSalary()" FROM Employee e \n    ORDER BY e.salary DESC\n    LIMIT 1 OFFSET N-1   \n  );\n   END IF;\nEND;\n$ LANGUAGE plpgsql;\n```
['PostgreSQL']