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
Which is faster joins or subqueries?
What are the types of subqueries?
How can a function retun more than one value in oracle with proper example?
Can ddl statements be used in pl/sql?
What is trigger with example?
what is data manipulation language? : Sql dba
How many unique keys can a table have?
Can we rename a column in the output of sql query?
What is online transaction processing (oltp)?
What is count * in sql?
What is the difference between joins?
how many sql ddl commands are supported by 'mysql'? : Sql dba
How can we implement rollback or commit statement in a trigger?
What is a mutating table and a constraining table?
What is the difference between a primary key and a unique key?