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
Mention what does the hierarchical profiler does?
Can we insert data into materialized view?
What is partition by in sql?
What are the different schemas objects that can be created using pl/sql?
What is number function in sql?
Are stored procedures compiled?
how does a local variable is defined using t-sql? : Transact sql
Can we insert data in view?
What is sqlite format?
What is the use of index in sql?
What is the difference between drop and truncate commands?
Why we use sql profiler?
What is bitemporal narrowing?
What is dml with example?
Is hadoop a nosql?