i need department wise top 2 employees salary.which logic
i will use
Answer Posted / neetika vardhan
SELECT dept, MAX(sal)
FROM EMP WHERE sal NOT IN (SELECT MAX(sal) FROM emp GROUP
BY dept)
GROUP BY dept
UNION
SELECT dept, MAX(sal)
FROM EMP
GROUP BY dept
| Is This Answer Correct ? | 17 Yes | 8 No |
Post New Answer View All Answers
What is the difference between delete and truncate commands?
How many sql databases can you have on one server?
How much does sql certification cost?
How we can create a table in pl/sql block. Insert records into it? Is it possible by some procedure or function? Please give example?
Can we use rowid as primary key?
Is sql easier than java?
What is difference between pls_integer and integer?
a table has 2 classifications 1)liabilities 2)earnings this liabitity has 2 elements with 2 input values and the earnings have 2 elements with 2 input values i wrote a query so that my input is liability savings amount1 amount2 xxxx null xxxxxx 0 xxx1 null xxxxx1 0 null yyyy 0 yyyy null yyy1 0 yyy1 my problem is --when i developed a report(d2k) with this data my o/p is liabilities,amount1,savings,amount2 xxxx xxxxxx xxx1 xxxxx1 yyyy yyyy yyy1 yyy1 how could i move this savings,savings values 2 palces up. can any body provide me witha better solution
What is materialized view. What are different methods of refresh?
What is java sql connection?
Why is a trigger used?
what is the difference between join and union? : Sql dba
How long it takes to learn pl sql?
What are types of exception?
How you can copy a file to file content and file to pl/sql table in advance pl/sql?