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

I Have Employee table having column name as ID,SALARY
how to get second max salary from employee table with id
ex
ID SALARY
1 20000
7 37000
2 5000

Answer Posted / deepa

drop table #temp
select top 2 identity(int,1,1) as SlNo, *
into #temp from employee order by salary desc
select * from #temp where SlNo = 2

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is resultset an interface?

905


Explain primary key?

902


Why variables called the most powerful component of ssis?

1027


How to access the deleted record of an event?

978


How to count rows with the count(*) function in ms sql server?

952


Can we create clustered index on composite key?

982


write an SQL query to list the employees who joined in the month of January?

1625


What is nolock hint in sql server 2008

1078


What is the minimum recommended amount of ram for sql server 2012 enterprise?

889


How to get the definition of a stored procedure back?

922


Types of Authentications in Sql Server? How user gets authenticated through windows authentication?

990


Tell me what is the significance of null value and why should we avoid permitting null values?

930


Explain the difference between clustered and non-clustered index?

872


Do you know what are the properties of the relational tables?

983


What do you mean by normalisation?

965