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

Why do we use view in sql?

970


What is localdb mssqllocaldb?

1070


What is the difference between joins?

1047


What is the cause of mutating table error and how can we solve it?

1054


Which is better cte or subquery?

1033


What is the difference between microsoft sql and mysql?

967


What is group by in sql?

1089


How we can update the view?

1054


How can we debug in PL/SQL?

1137


What is a sql driver?

1004


What is mutating sql table?

1116


Which data type is a composite type?

993


What are procedures used for?

990


What is thread join () in threading?

1019


What is an emotional trigger?

1008