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 / kesava
100% sure execute
select * from emp
where hiredate between
trunc(add_months(last_day(sysdate),-3)+1) and
trunc(add_months(last_day(sysdate),-1))
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Inline the values in PL/SQL, what does it mean.?
What is benefit of creating memory optimized table?
Does pl sql work in mysql?
Why should I use postgresql?
What are schema-level triggers?
What are the uses of sysdate and user keywords?
how to load data files into tables with 'mysqlimport'? : Sql dba
How many joins can you have in sql?
explain the options of myisamchk to improve the performance of a table. : Sql dba
What is rename command in sql?
How do you optimize a stored procedure in sql?
What are pl/sql cursor exceptions?
what is myisam? : Sql dba
what is log shipping? : Sql dba
What is the command used to fetch the first 5 characters of a string?