Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Can a composite key be null?

910


What is the difference between left outer join and left join?

943


How do I view stored procedures?

916


Can one improve the performance of sql*loader? : aql loader

981


What are the different dml commands in sql?

1085


Explain the insert into statements in sql?

935


how many tables will create when we create table, what are they? : Sql dba

1019


What is the use of <> sql?

931


Can I join the same table twice?

994


Explain how you can copy a file to file content and file to pl/sql table in advance pl/sql?

955


What is information schema in sql?

1013


tell us something about heap tables. : Sql dba

1048


What is the difference between the sql*loader and import utilities? : aql loader

976


What does pl sql developer do?

882


What are string functions in sql?

1170