From an Employee table, how will you display the record
which has a maximum salary?

Answers were Sorted based on User's Feedback



From an Employee table, how will you display the record which has a maximum salary?..

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

From an Employee table, how will you display the record which has a maximum salary?..

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

From an Employee table, how will you display the record which has a maximum salary?..

Answer / anil

select * from test.emp where salary=(select max(salary) from test.emp);

Is This Answer Correct ?    1 Yes 0 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / amit kumar agarwalla

select * from employees
where salary=(select max(salary) from emplpoyees);

Is This Answer Correct ?    1 Yes 0 No

From an Employee table, how will you display the record which has a maximum salary?..

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

From an Employee table, how will you display the record which has a maximum salary?..

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

From an Employee table, how will you display the record which has a maximum salary?..

Answer / pree

Select name,salary from Employee where salary in(select max
(salary)
from Employee );

Is This Answer Correct ?    0 Yes 0 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / apsar

select * from (select e.* from emp order by e.sal desc)

Is This Answer Correct ?    0 Yes 0 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / dinesh kumar

select * from employee where salary =( select max(salary) from
employee);

Is This Answer Correct ?    0 Yes 0 No

From an Employee table, how will you display the record which has a maximum salary?..

Answer / sandeep

Select * from employee where rownum=1 order by sal desc

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What are the difference between Functions/Stored Procs and Triggers and where are they used.

1 Answers   CGI, TCS,


what is difference between decode and case function?

2 Answers  


What is sql analyzer?

0 Answers  


What is the difference between count 1 and count (*) in a sql query?

0 Answers  


what is Complex index. how to create it?

2 Answers  






what is the difference between truncate and delete statement? : Transact sql

0 Answers  


What is the difference between inner join and outer join?

0 Answers  


Can you call pl/sql package functions from within a fast formula?

0 Answers  


Can we debug stored procedure?

0 Answers  


What is trigger types of trigger?

0 Answers  


can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba

0 Answers  


What is output spooling in sql*plus?

0 Answers  


Categories