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 / elumalai.k

select top1 id,salary from employee
where
(salary<(select max (salary) As sal from employee As Empp))
orderby salary desc.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we add an identity column to decimal datatype?

1003


How is foreign key related to primary key?

973


How can we get count of the number of records in a table?

957


tell me what is blocking and how would you troubleshoot it? : Sql server database administration

908


Can we use pragma autonomous_transaction in trigger?

963


what is hash nonclustered index

973


What is code near application topology?

279


What program is used to store the data source file?

968


What are the difference between clustered and a non-clustered index?

1046


What is server-level principal?

122


Is sql server 2016 free?

947


How to specify the collation for a character data type in ms sql server?

1035


What stored procedure can you use to display the current processes?

899


How do I edit a stored procedure in sql server?

930


How will you optimize a stored procedure optimization?

1047