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 secondary keys?

654


what is cursor. write example of it. What are the attributes of cursor.

839


Which command is used to delete a trigger?

877


how to present a past time in hours, minutes and seconds? : Sql dba

651


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

648






Which table is left in left join?

624


Why commit is not used in triggers?

675


What is sequence in sql?

608


What type of database is sql?

688


Can you rollback after commit?

625


How are sql commands classified?

681


How to call a javascript function from pl sql?

649


Do we need to rebuild index after truncate?

624


What is pl sql in oracle?

688


What are tables in sql?

633