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
What is sql and db2?
What is nosql vs sql?
Define select, insert, create, delete, update, drop keywords
What can sql server reporting services do?
What is the difference between view and stored procedure?
What is sql*plus?
What is rollback?
how is exception handling handled in mysql? : Sql dba
what is unique key constraint? : Sql dba
If a cursor is open, how can we find in a pl/sql block?
why does the selected column have to be in the group by clause or part of an aggregate function? : Sql dba
What is mutating sql table?
What does select count (*) mean in sql?
what are date and time functions in mysql? : Sql dba
What are % type and % rowtype?