Write a query to get 2nd maximum salary in an employee table ?
Answer Posted / priya
select rownum,empno,sal from (select
rownum,empno,sal from emp order by sal desc) group
by rownum,empno,sal having rownum=2;
This will clearly work.............
Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
How do I view stored procedures?
what is a foreign key ? : Sql dba
What is minus?
What is a subquery in sql?
Can we write dml inside a function in sql server?
Is pl sql better than sql?
How can I speed up sql query?
Why is stored procedure faster than query?
What does count (*) mean in sql?
What packages(if any) has oracle provided for use by developers?
What do we need to check in database testing?
What are different clauses used in sql?
What is the difference between union and union all command?
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 are the sql commands?