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 / shanmukha srinivas
1)last two months joined employees
select * from emp where hiredate between add_months(trunc(sysdate,'month'),-2) and trunc(sysdate,'month')
2)last two months joined employees from today
select * from emp where hiredate between add_months(trunc(sysdate),-2) and trunc(sysdate)
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Why do we use view in sql?
What is localdb mssqllocaldb?
What is the difference between joins?
What is the cause of mutating table error and how can we solve it?
Which is better cte or subquery?
What is the difference between microsoft sql and mysql?
What is group by in sql?
How we can update the view?
How can we debug in PL/SQL?
What is a sql driver?
What is mutating sql table?
Which data type is a composite type?
What are procedures used for?
What is thread join () in threading?
What is an emotional trigger?