How to find third or nth
maximum salary from salary table(EmpID,EmpName,EmpSalary)
in Optimized way?
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- What is the best way to cache a table from a (SQL)
- php PDO::FETCH_ASSOC doesnt detect select after ba
By subquery:
Row Number :
Sub Query :
Top Keyword :
Replace N with your Max Number
Explanation
The query above can be quite confusing if you have not seen anything like it before – the inner query is what’s called a correlated sub-query because the inner query (the subquery) uses a value from the outer query (in this case the Emp1 table) in it’s WHERE clause.
And Source
another way to find last highest data based on date
Try this code :-