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

Which sql server table is used to hold the stored procedure script?

927


Can you give me some DBCC command options?(Database consistency check) - DBCC CHECKDB - Ensures that tables in the db and the indexes are correctly linked.and DBCC CHECKALLOC - To check that all pages in a db are correctly allocated. DBCC SQLPERF - It gives report on current usage of transaction log in percentage. DBCC CHECKFILEGROUP - Checks all tables file group for any damage.

2497


Why should we go for stored procedures? Why not direct queries?

1072


What is self contained scalar sub query?

959


What is difference between standardization and normalization?

1069


How will you add a dimension to cube? : sql server analysis services, ssas

1060


How to modify existing triggers using "alter trigger"?

990


How to use the inserted and deleted pseudo tables?

946


What happens if you add a new index to large table?

919


can a database be shrunk with users active? : Sql server administration

988


what is an index? : Sql server database administration

958


How to use go command in "sqlcmd"?

1183


What is the use of group by clause?

931


What are indexes in sql?

1248


Can binary strings be used in arithmetical operations?

911