arvind kumar


{ City } gorakhpur
< Country > india
* Profession * developer
User No # 91832
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 0
Users Marked my Answers as Wrong # 1
Questions / { arvind kumar }
Questions Answers Category Views Company eMail




Answers / { arvind kumar }

Question { 19637 }

how to retrieve last tree records from table?
select *from emp where rownum > (select count(*)-3 from
emp);
i am using this query to get last three records from table
but its not giving any output, so please tell me what is the
error in this query.


Answer

select * from employees minus select * from employees where
rownum < (select count(*)-2 from employees);

Is This Answer Correct ?    0 Yes 0 No

Question { TCS, 34259 }

Query for second maximum salary in each in each department


Answer

select * from employees e where (select count(salary) from
employees where salary >=e.salary)=2;

Is This Answer Correct ?    0 Yes 1 No