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.

Answers were Sorted based on User's Feedback



I want to display the employees who have joined in last two months. (It should be executed randomly..

Answer / pracheth

select * from temployees where to_char(hiredate,
'month') in
(to_char(trunc(sysdate,'month')-30,'month'),to_char(trunc(sysdate,'month')-60,'month'))

Is This Answer Correct ?    0 Yes 1 No

I want to display the employees who have joined in last two months. (It should be executed randomly..

Answer / venu

select * FROM(SELECT ENAME, Abs(to_date('&DATE' ,'dd/mm/yy')- HIREDATE) AS DATES FRom EMP) where dates<60;

Is This Answer Correct ?    0 Yes 1 No

I want to display the employees who have joined in last two months. (It should be executed randomly..

Answer / subbu

Assuming that the Table name is "Employee" & his/her date of
joining is stored in column "JoiningDate". Below query gives
you the result


If (Month(GetDate()))=1
Select * from Employee Where (Month(JoiningDate)) in (11,12)
And Year(JoiningDate)=Year(GetDate()-1)
Else if Month(GetDate())=2
Select * from Employee Where (Month(JoiningDate)=12 And
Year(JoiningDate)=Year(GetDate()-1)) or
(Month(JoiningDate)=1 And Year(JoiningDate)=Year(GetDate()))
Else
Select * from Employee Where
Year(JoiningDate)=Year(GetDate())And
Month(JoiningDate)>=Month(GetDate()-2) And
Month(JoiningDate)<=Month(GetDate()-1)

Is This Answer Correct ?    0 Yes 4 No

I want to display the employees who have joined in last two months. (It should be executed randomly..

Answer / xyz

select * from emp where add_months(sysdate ,-2);

Is This Answer Correct ?    1 Yes 9 No

I want to display the employees who have joined in last two months. (It should be executed randomly..

Answer / test

Join_date is the column in Emp table.

select * from emp
where join_date between sysdate and sysdate - 60

Is This Answer Correct ?    2 Yes 11 No

Post New Answer

More SQL PLSQL Interview Questions

What is the clause we need to add in function body to return variable?

0 Answers  


What are sql objects?

0 Answers  


function can return value ,procedure also return value through out parameter then what is the difference?

3 Answers   3i Infotech,


what are the advantages of sql ? : Sql dba

0 Answers  


i have a customer table. trans_id trans_date trans_amt debit_credit_indicator 001 01-JAN-13 1099 cr 001 12-JAN-13 500 db 002 24-FEB-13 400 db 002 23-MAR-13 345 cr 001 18-APR-13 800 cr 002 15-MAR-13 600 db 001 12-FEB-13 200 cr i want like this output. trans_id trans_amt debit_credit_indicator i want get highest credit amount and lowest credit amount and highest debit amount and lowest debit amount for each trans_id. pls give me answer. i want urgent

3 Answers  


Why we use pl sql?

0 Answers  


What is difference between hql and sql?

0 Answers  


What is record data type?

0 Answers  


How to call shell script from pl sql procedure?

0 Answers  


List the various privileges that a user can grant to another user?

0 Answers  


What are joins in sql?

0 Answers  


What does select top 1 do in sql?

0 Answers  


Categories