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


To find second largest salary in Employee table

Answers were Sorted based on User's Feedback



To find second largest salary in Employee table..

Answer / anu

Select max(Sal) from emp
Where
Sal
<
(Select max(Sal) from emp);

Is This Answer Correct ?    0 Yes 0 No

To find second largest salary in Employee table..

Answer / sujith

select empname,salary from(
select empname,salary, rank() over( order by salary desc) ss from emp)
where ss=2;

Is This Answer Correct ?    3 Yes 4 No

To find second largest salary in Employee table..

Answer / ela tiku

Select Max(SAL) FROM emp WHERE sal<(SELECT MAX(SAL) FROM
emp)


<<<assuming sal is the column name and emp is the table
name>>>

Is This Answer Correct ?    0 Yes 1 No

To find second largest salary in Employee table..

Answer / kuduba.r

select max(salary) from emp where sal<(select max(salary)
from emp)

Is This Answer Correct ?    0 Yes 1 No

To find second largest salary in Employee table..

Answer / anjum

SELECT MAX(SALARY)FROM EMP WHERE SALARY(SELECT MAX(SALARY)
FROM EMP)

Is This Answer Correct ?    0 Yes 1 No

To find second largest salary in Employee table..

Answer / murugesh

select * from (select row_number over( order by salary
desc) as salcount,empid,salary from employee) emp
where emp.salcount = 2

Is This Answer Correct ?    1 Yes 2 No

To find second largest salary in Employee table..

Answer / chitharthan

select max(salary)-1 from employeetable

Is This Answer Correct ?    0 Yes 10 No

Post New Answer

More SQL Server Interview Questions

Explain what is sql server english query?

0 Answers  


I have Two table First have UserName and second is address, in address table more than value relegated to UserName table, i want to fetch 2nd address if exist other wise 1st address access

4 Answers  


how will add additional conditions in sql?

0 Answers   Amdocs, Apps Associates,


Can a stored procedure call itself(recursive). If yes what level and can it be controlled.?

2 Answers  


Explain what are db_options used for?

1 Answers   InterGraph,


Is sql different from sql server?

0 Answers  


List some major differences between triggers and stored procedures?

0 Answers  


Explain go command in sql server?

0 Answers  


How to disable a login name in ms sql server?

0 Answers  


What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security

0 Answers  


What is the difference between MVC and Teir Architecher? Plz explain with Layyered Programming example...? Thanks

0 Answers   TCS,


Do you know the cursor types?

0 Answers  


Categories