From an Employee table, how will you display the record
which has a maximum salary?
Answers were Sorted based on User's Feedback
Answer / amedela chandra sekhar
sql> select * from emp where sal=(select max(sal) from emp);
chandumba2005@gmail.com
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / mayank kumar
<-- it will display max salary only-->
Select max(distinct salary)
from employee;
<-- it will display all information of employee having max salary -->
select * from employees
where salary=(select max(distinct salary) from employees);
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / anil
select * from test.emp where salary=(select max(salary) from test.emp);
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / amit kumar agarwalla
select * from employees
where salary=(select max(salary) from emplpoyees);
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / mrityunjay singh
select *from employees where rownum<2 order by salary desc;
or
select * from employee where sal=(select max(sal) from
employee);
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / mohan
select * from emp where sal in(select max(sal) from emp);
or
select * from emp where sal=(select max(sal) from emp);
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / pree
Select name,salary from Employee where salary in(select max
(salary)
from Employee );
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / apsar
select * from (select e.* from emp order by e.sal desc)
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / dinesh kumar
select * from employee where salary =( select max(salary) from
employee);
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sandeep
Select * from employee where rownum=1 order by sal desc
Is This Answer Correct ? | 0 Yes | 0 No |
What are the difference between Functions/Stored Procs and Triggers and where are they used.
what is difference between decode and case function?
What is sql analyzer?
What is the difference between count 1 and count (*) in a sql query?
what is Complex index. how to create it?
what is the difference between truncate and delete statement? : Transact sql
What is the difference between inner join and outer join?
Can you call pl/sql package functions from within a fast formula?
Can we debug stored procedure?
What is trigger types of trigger?
can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba
What is output spooling in sql*plus?