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 / 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


Please Help Members By Posting Answers For Below Questions

What is sql query limit?

969


What is a data manipulation language?

1016


difference between anonymous blocks and sub-programs.

1123


How we can update the view?

1043


What is the difference between sql and isql*plus?

1083


How do you determine the current isolation level? : Transact sql

1146


what is the difference between $message and $$message? : Sql dba

991


What are the different ddl commands in sql?

1151


How do I get sql certification?

957


what are all different types of collation sensitivity? : Sql dba

976


How insert into statements in sql?

1065


Does truncate need commit?

933


discuss about myisam index statistics collection. : Sql dba

941


What is insert command in sql?

1118


Does google use sql?

947