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 packages are available to pl/sql developers?

597


How do I count rows in sql?

557


What is exception? What are the types of exceptions?

552


What is percent sign in sql?

713


What are sql procedures?

574






What is sql keyword?

559


What does subquery mean in sql?

536


Are stored procedures faster than dynamic sql?

528


Is a secondary key the same as a foreign key?

488


Explain autonomous transaction.

632


Which is faster truncate or drop?

556


What company owns postgresql?

560


what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba

525


What is bitemporal narrowing?

722


What is compilation error in pl sql?

504