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...

1. How to fetch all the duplicate records from the table.

2. How to fetch the second highest salary from the table.

Answer Posted / saradhi

How to fetch the second highest salary from the table.
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP n salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary
where n > 1 (n is always greater than one)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain transaction server auto commit?

1092


How do I start sql server agent automatically?

1027


What are the differences between stored procedure and the dynamic sql?

1141


Can we use having clause without group by?

1032


how can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role? : Sql server administration

1042


What is open database communication (odbc)?

1118


Explain mixed authentication mode of sql server?

1120


Can a table have 2 foreign keys?

958


What are functions in the sql server?

1295


What is wrong with sql server client libarary dll, ntwdblib.dll?

1094


What do you mean by data integrity?

1129


Explain what are magic tables in sql server?

1047


Tell me what is the stuff and how does it differ from the replace function?

1035


What are the advantages of sql azure?

140


Why should one not prefix user stored procedures with ‘sp_’?

1100