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 record variable?
What does pl sql stand for?
What is sap sql anywhere?
What is the difference between unique and primary key constraints?
Why stored procedure is better than query?
How can you fetch common records from two tables?
What are the possible values for the boolean data field?
What is indexes?
How does cross join work?
How can one get sql*loader to commit only at the end of the load file? : aql loader
what is a cursor? : Sql dba
what is 'mysqlcheck'? : Sql dba
What is crud sql?
What is set serveroutput on in pl sql?
Explain the update statement in sql