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 / bhagya

select * from emp as e1 where 1= (select count(*)from emp
as e2 where e1.sal<e2.sal)

Is This Answer Correct ?    9 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the reporting services components?

144


How to run queries with sql server management studio express?

1157


What is the use of sql profiler in sql server 2012?

947


How can I know what locks are running on which resource?

1002


Explain the properties of a relational table?

1079


How can you list all the columns in a database?

975


How to resolve the orphan use problem? : sql server security

1078


How to generate create function script on an existing function?

1185


What are the differences between ms sql server & oracle?

1120


What is the stuff and how does it differ from the replace function?

1230


Can we add our custom code in ssis?

1042


What is database black box testing?

1078


Explain Geography datatype in SQL Server

1198


What is forward - only cursors / read only cursor?

1136


What is cdc in sql server?

1046