Answer Posted / kanhu charan biswal
select ename, sal from emp where sal=(select max(sal) from
emp);
For see the max(sal) with ename departmentwise the query
will be:
select ename,sal from emp a
where sal in (select max(sal) from emp group by deptno);
For findout the nth highest salary with name, the query
will be:
select ename,sal from emp a
where &n=(select count(distinct sal) from emp b
where b.sal>=a.sal)
after execute the query it will ask you to pass a value
for 'n'.it stands for nth hiest salary
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are types of exception?
what is sub-query? : Transact sql
i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5
Explain unique key in sql.
Is sql a backend?
how to write date and time literals? : Sql dba
What is pivot table in sql?
What do you understand by pl/sql packages?
What is percent sign in sql?
What do you think about pl/sql?
Which constraints we can use while creating database in sql?
What is the difference between delete, truncate and drop command?
Explain sql data types?
What is the difference between function and procedure in pl/sql?
Does sql between include endpoints?