I want to display the employees who have joined in last two
months. (It should be executed randomly means If I execute
the query in March it should display Jan and Feb joined
employees. Same query if i execute in Feb, 2007 it should
display dec, 2006 and jan 2007 joined employees.

Answer Posted / kesava

100% sure execute

select * from emp
where hiredate between
trunc(add_months(last_day(sysdate),-3)+1) and
trunc(add_months(last_day(sysdate),-1))

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the differences between binary and varbinary? : Sql dba

533


What are sql constraints?

566


Name some usages of database trigger?

564


Which sql statement is used to delete data from a database?

467


What does select count (*) mean in sql?

552






How do I run a script in sql developer?

496


Do we need to rebuild index after truncate?

529


How to change the order of columns in Oracle SQL Plus ?

616


Is oracel sql developer written in java?

648


What is sql engine in oracle?

524


what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba

554


What does <> sql mean?

542


Does sql*plus also have a pl/sql engine?

563


What is the difference between joins?

536


What is the use of stored procedures?

519