Answer Posted / zeljko
This answer_10 will work only if there is not order by used
on select statement.
I recommend using dense_rank function to get second row out
as in example;
SELECT * FROM (
SELECT id, first_name, salary,
DENSE_RANK() OVER(ORDER BY salary desc) row_order
FROM employee)
WHERE row_order = 2;
| Is This Answer Correct ? | 11 Yes | 2 No |
Post New Answer View All Answers
What is a recursive stored procedure?
How can we make an if statement within a select statement?
What is foreign key in sql with example?
What are different types of indexes?
what are properties of a transaction? : Sql dba
What is the usage of sql functions?
how would concatenate strings in mysql? : Sql dba
What is difference between my sql and sql?
what is the difference between clustered and non clustered index in sql? : Sql dba
What is hibernate and its relation to sql?
What is pessimistic concurrency control? : Transact sql
Can you join a table to itself?
How to select unique records from a table?
Why do we need sharding?
How do I view a view in sql?