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 is tuple in sql?

0 Answers  


How delete all records from table in sql?

0 Answers  


what is the difference between cursor FETCH and FOR LOOP ?

3 Answers   CG-VAK, Tech Mahindra,


What is the advantage of index in sql?

0 Answers  


What is difference between select statement and cursor

3 Answers   JDA,






one of the column in my table contains the data like SAL ---- 1000 1000 2000 3000 3000 So my requirement is i want output like SAL --- 1000 2000 3000 it mean i want to delete duplicate rows only how should u write query?

9 Answers   TCS,


need to split a string into seperate values. eg. col1 col2 ---------- 100 - 'a,b,c' 200 - 'a,x,b,d,e' 300 - 'c' result: value count ------------- a - 2 b - 1 c - 2 etc.

1 Answers  


What is a data definition language?

0 Answers  


What is delimiter in pl sql?

0 Answers  


When you have to use a default "rollback to" savepoint of plvlog?

0 Answers  


Write a query to find second highest salary of an employee.

27 Answers  


What is the location of pre_defined_functions.

0 Answers  


Categories