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 / raji_4u

select *
from emp
where hiredate
between add_months(trunc(sysdate,'Month'),-2)
and trunc(sysdate,'Month')-1

This works for sure. 100 %

Is This Answer Correct ?    14 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we insert delete data in view?

644


How to avoid duplicate records in a query?

668


What is pl sql script?

653


What is indexing in sql and its types?

630


What is difference between pls_integer and integer?

596






Can we delete column in sql?

663


Can we create table inside stored procedure?

609


How to combine two stored procedures in sql?

700


How long it takes to learn pl sql?

622


Which are sql * plus commands?

623


What are the types of dbms?

628


define data blocks ? : Sql dba

653


Which join condition can be specified using on clause?

608


How many sql statements are used?

673


What is pl sql in dbms?

592