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
What is sql query limit?
What is a data manipulation language?
difference between anonymous blocks and sub-programs.
How we can update the view?
What is the difference between sql and isql*plus?
How do you determine the current isolation level? : Transact sql
what is the difference between $message and $$message? : Sql dba
What are the different ddl commands in sql?
How do I get sql certification?
what are all different types of collation sensitivity? : Sql dba
How insert into statements in sql?
Does truncate need commit?
discuss about myisam index statistics collection. : Sql dba
What is insert command in sql?
Does google use sql?