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

select *
from emp
where hiredate
between add_months(trunc(sysdate,'Month'),-2)
and trunc(sysdate,'Month')-1

This works for sure. 100 %

Is This Answer Correct ?    14 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of constraints?

1158


What makes a good primary key?

1017


What is the primary key?

937


How many types of primary keys are there?

1022


How do I create a sql database?

984


what is collation? : Sql dba

1133


Which are the different character-manipulation functions in sql?

1042


How many row comparison operators are used while working with a subquery?

1020


What is attribute indicator in pl sql?

1001


What is cursor explain with example?

966


What is file based approach?

926


What is transaction control language (tcl)?

1120


How do you pronounce sql?

991


What is an example of translating a date into julian format?

1103


how to check myisam tables for errors? : Sql dba

1306