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 is tuple in sql?
How delete all records from table in sql?
what is the difference between cursor FETCH and FOR LOOP ?
3 Answers CG-VAK, Tech Mahindra,
What is the advantage of index in sql?
What is difference between select statement and cursor
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?
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.
What is a data definition language?
What is delimiter in pl sql?
When you have to use a default "rollback to" savepoint of plvlog?
Write a query to find second highest salary of an employee.
What is the location of pre_defined_functions.