Nth Highest Salary
Nice. DISTINCT clause consider NULL to be a unique value in SQL!
put limit N, 1 not N-1
it's remarkable. thanks!
@xiuyi I am afraid that ifnull is not redunant. Because the problem tell us "If there is no nth highest salary, then the query should return null". Without ifnull, the query wouldn't return null as expected.
It's not clear why you had to use another variable M and set to N-1, rather than just using N-1 directly in the limit clause. I know that causes an error, but why exactly?
No one has replied
w3c sql top
guess you cannot do calculations within "LIMIT x,y"
Disabled Categories are greyed out
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.