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

Which is faster joins or subqueries?

1037


What are the types of subqueries?

1102


How can a function retun more than one value in oracle with proper example?

1129


Can ddl statements be used in pl/sql?

1193


What is trigger with example?

1170


what is data manipulation language? : Sql dba

1071


How many unique keys can a table have?

1070


Can we rename a column in the output of sql query?

1042


What is online transaction processing (oltp)?

1068


What is count * in sql?

1040


What is the difference between joins?

1094


how many sql ddl commands are supported by 'mysql'? : Sql dba

1066


How can we implement rollback or commit statement in a trigger?

1085


What is a mutating table and a constraining table?

1178


What is the difference between a primary key and a unique key?

1108