i need department wise top 2 employees salary.which logic
i will use
Answer Posted / shreya
select level,deptno,max(sal)
from emp
where level in (1,2)
connect byy prior sal>sal
group by level,deptno
order by deptno
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is sql constant?
What is normalization in a database?
What is the difference between mdf and ndf files?
How do you run a query?
How to select 10 records from a table?
What is the difference between a primary key and a unique key?
how many values can the set function of mysql take? : Sql dba
Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
How does pl sql work?
Mention what plvcmt and plvrb does in pl/sql?
What is over () in sql?
What are the types of optimization?
how to use in conditions? : Sql dba
What does data normalization mean?
Why are aggregate functions called so?