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 / arijit
take Mon(like sep,oct,mar etc)
and year( like 2006,2007,1980 etc) as input...
and execute this query..
select empno,ename,hiredate from emp1
where hiredate between
add_months(to_date('01-'|| upper('&Mon')||'-'||&yr,'DD-MON-
YYYY'),-2) and last_day(add_months(to_date('01-'|| upper
('&Mon')||'-'||&yr,'DD-MON-YYYY'),-1))
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Is sqlite good enough for production?
Does truncate release storage space?
What is the usage of nvl function?
What is the least restrictive isolation level? : Transact sql
What is a join query?
What is data type in sql?
What is sql used for?
What is scope and visibility in PL/SQL?
Why is there a need for sqlcode and sqlerrm variables?
What is type and rowtype in pl sql?
what is an extent ? : Sql dba
How does rowid help in running a query faster?
Is join an inner join?
Can a table have no primary key?
What are the differences between implicit and explicit cursors?