how to retrive only second row from table?

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


Please Help Members By Posting Answers For Below Questions

What is difference between pl and sql?

526


What are records give examples?

551


How many disk partitions should I have?

542


Explain the advantages and disadvantages of stored procedure?

634


What is the use of procedures?

532






What are the types of functions in sql?

556


What are the most important characteristics of pl/sql?

565


How delete all data from table in sql?

562


What is difference between inner join and cross join?

514


What is schema in sql example?

591


Explain constraints in sql?

563


First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.

1132


Is nosql relational?

538


how to fetch common records from two tables? : Sql dba

616


Mention what plvcmt and plvrb does in pl/sql?

626