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

What is cartesian join in sql?

559


What are the different dml commands in sql?

586


What are keys in sql?

551


what is a foreign key ? : Sql dba

609


Can we perform dml on view?

556






What is sql injection owasp?

548


What are schema-level triggers?

582


What is a common use of group by in sql?

592


How does sql developer connect to oracle database?

524


What does the argument [or replace] do?

581


What is java sql package?

536


Is sql microsoft?

547


how is myisam table stored? : Sql dba

607


Is nosql faster than sql?

542


How does cross join work?

504