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
What is difference between pl and sql?
What is the difference between nvl function, ifnull function, and isnull function?
What are the basic sql commands?
Is sql a dbms?
how to analyze tables with 'mysqlcheck'? : Sql dba
What is cost in sql execution plan?
Is it possible to create the following trigger: before or after update trigger for each row?
Why do we use triggers?
How to write pl sql program in mysql command prompt?
How do I find duplicates in two columns?
How can you get sql*loader to commit only at the end of the load file? : aql loader
what is the difference difference between procedure and packages
What are the advantages of sql?
What is coalesce sql?
Can we use delete in merge statement?