Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 a recursive stored procedure?

1177


How can we make an if statement within a select statement?

1008


What is foreign key in sql with example?

929


What are different types of indexes?

1007


what are properties of a transaction? : Sql dba

1092


What is the usage of sql functions?

1144


how would concatenate strings in mysql? : Sql dba

1090


What is difference between my sql and sql?

1062


what is the difference between clustered and non clustered index in sql? : Sql dba

1123


What is hibernate and its relation to sql?

1119


What is pessimistic concurrency control? : Transact sql

1084


Can you join a table to itself?

1122


How to select unique records from a table?

1054


Why do we need sharding?

986


How do I view a view in sql?

948