Write a query to find second highest salary of an employee.
Answers were Sorted based on User's Feedback
Answer / preetir
select min(sal) from (select distinct sal from emp order by
desc where rownum < 2)
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / arif saulat
select * from emp where sal <(select max(sal) from emp)
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / deepshikha
SELECT MAX (sal)
FROM emp a,
(SELECT MAX (sal) max_sal
FROM emp) abc
WHERE a.sal < abc.max_sal
ORDER BY sal DESC;
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / vamana murthy
select ename,salary from emp
where rownum=2
order by salary desc
| Is This Answer Correct ? | 0 Yes | 7 No |
Use the below Query:
Select Max(salary) from Emp
Where Max(salary) < (Select Max(salary) from emp
where emp-no=101);
| Is This Answer Correct ? | 10 Yes | 18 No |
Answer / kitcat
SELECT salary
FROM (SELECT salary FROM emp
ORDER BY DESC salary)
WHERE RowNum=2
| Is This Answer Correct ? | 1 Yes | 11 No |
How many commands are in sql?
Can a foreign key have a different name?
write a procedure to print a statement or number not using "dbms_output.put_line" package.write a procedure instead of it using procdure name as "print" ex:- declare a number:=2; begin print(a); end; /* when U type above procedure 2 have to should be printed*/
I m giving Source, Destination and Age. Write a procedure or function, it will give to u this source to destination tickets are available or not, if available then check this person is senior citizen or not,if this person is senior citizen then give some discount. PLZ give this answer...... Thanks advance.....
What do you mean by stored procedures?
why should required nested tables, Object types, partition tables and varying arrays. what is the difference between these are all. give me example with explanation.
What are the triggers associated with image items?
What is pls_integer in pl sql?
What is a left inner join?
What are dml commands?
What is difference between stored procedures and application procedures?
What is the difference between a primary key and a unique key?
Oracle (3253)
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)