TGTGInsighttelegram intelligenceLIVE / telegram public index
Post content
Post content
π ππ»ππ²πΏππΆπ²ππ²πΏ: How do you find the Third Highest Salary in SQL? πββοΈπ π²: Just tweak the offset: SELECT DISTINCT salary FROM employees ORDER BY salary DESC LIMIT 1 OFFSET 2; π§ Logic Breakdown: - OFFSET 2 skips the top 2 salaries - LIMIT 1 fetches the 3rd highest - DISTINCT ensures no duplicates interfere β Use Case: Top 3 performers, tiered bonus calculations π‘Pro Tip: For ties, use DENSE_RANK() or ROW_NUMBER() in a subquery. π¬Tap β€οΈ for more!