SQL Medium Leetcode Problem Solved (
Vložit
- čas přidán 27. 07. 2024
- 📝 Get my free SQL Cheat Sheets: www.databasestar.com/get-sql-...
🎓 Learn and become confident in SQL: databasestar.mykajabi.com/sql...
This is a medium-level SQL question on Leetcode.
In this video, you'll learn what this problem is (Find the Nth Highest Salary), and how to solve it using SQL.
You'll also see how to fix the runtime errors often found in this solution, and how to include the parameter from the stored procedure.
⏱ TIMESTAMPS:
00:00 - The problem
01:51 - Step one for the solution
03:22 - Inside the function
04:56 - Making progress
06:14 - Include the parameter
🔗 VIDEO LINKS:
Leetcode problem: leetcode.com/problems/nth-hig... - Věda a technologie
Brilliant, thanks! It is convenient that offset returns null if there are not enough rows. One correction: you need to select distinct salary values, otherwise some test cases will fail.
That's a good point. The script had passed the existing test cases, but yes if there was different data then we may need to find the distinct values.
Great video your solution to the problem is amazingly well explained
Thanks! I’m glad you liked it.