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 are the types of subquery? : Sql dba
What is trigger price?
What is trigger types of trigger?
How do I create an index in word?
How does a covering index work?
What is dense_rank?
What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql
Is sql better than access?
How do I run a sql query?
What is rowid in sql?
How many row comparison operators are used while working with a subquery?
What is a left inner join?
what is the difference between undefined value and null value? : Sql dba
What is the usage of when clause in trigger?
What is function and procedure in pl sql?