To find second largest salary in Employee table
Answers were Sorted based on User's Feedback
Answer / anu
Select max(Sal) from emp
Where
Sal
<
(Select max(Sal) from emp);
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
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 |
Answer / kuduba.r
select max(salary) from emp where sal<(select max(salary)
from emp)
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / anjum
SELECT MAX(SALARY)FROM EMP WHERE SALARY(SELECT MAX(SALARY)
FROM EMP)
| Is This Answer Correct ? | 0 Yes | 1 No |
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 |
Explain what is sql server english query?
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
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.?
Explain what are db_options used for?
Is sql different from sql server?
List some major differences between triggers and stored procedures?
Explain go command in sql server?
How to disable a login name in ms sql server?
What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security
What is the difference between MVC and Teir Architecher? Plz explain with Layyered Programming example...? Thanks
Do you know the cursor types?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)