consider a table which contain 4 columns,ename,eno,sal and
deptno, from this table i want to know ename who having
maximum salary in deptno 10 and 20.
Answer Posted / gautam
select ename,sal from emp
where sal in (select max(sal) from emp group by deptno)
and deptno in (10,20)
Gautam
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
Why is stored procedure faster than query?
How do I tune a sql query?
How is indexing done in search engines?
Are subqueries faster than joins?
Mention what does plv msg allows you to do?
explain the options of myisamchk to improve the performance of a table. : Sql dba
Does mysql_real_escape_string prevent sql injection?
Which normal form is best?
Is nosql faster than sql?
What is the use of partition by in sql?
what is cursor. write example of it. What are the attributes of cursor.
Which are the different character-manipulation functions in sql?
Which certification is best for sql?
what is a constraint? : Sql dba
How do you update a value in sql?