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 are different types of keys?
how to enter characters as hex numbers? : Sql dba
What is the difference between union and union all command?
How to avoid using cursors?
who introduced sql?
Why we use triggers in mysql?
What is error ora-12154: tns:could not resolve the connect identifier specified?
What is a sql instance vs database?
How many functions are there in sql?
what is 'mysqladmin' in mysql? : Sql dba
What sql database should I use?
How delete all data from all tables in sql?
Which command is used to call a stored procedure?
how to use like conditions? : Sql dba
What is sql in oracle?