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 Row versions of DataRow?

978


You want to use bids to deploy a report to a different server than the one you chose in the report wizard. How can you change the server url?

147


Describe in brief system database.

952


Is the primary key column of a table an index in ms sql server?

920


What is the impact on other user sessions when creating indexes?

876


what are defaults? : Sql server database administration

1008


How to delete all rows with truncate table statement in ms sql server?

932


What is the standby server?

909


How except clause is differs from not in clause?

899


Which data types generate inaccurate results if used with an = or <> comparison in a where clause of a sql statement?

996


What do mean by xml datatype?

1009


Which language is supported by sql server?

956


How to install sql server 2005 express edition?

1058


What are sub reports and how to create them?

124


What is the query and subquery?

1028