GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Database  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 95 of 143    Print  
Write a query to find the list of employees whos age is greater than 30 or so given a date of birth column

  
Total Answers and Comments: 7 Last Update: May 06, 2007     Asked by: rekssql 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 12, 2007 04:54:08   
Savitha        

RE: Write a query to find the list of employees whos a...

SELECT SSN ENAME

FROM EMP

WHERE DATEDIFF(YEAR DOB GETDATE())>30


 
Is this answer useful? Yes | No
January 12, 2007 23:19:00   
rekssql Member Since: January 2007   Contribution: 2    

RE: Write a query to find the list of employees whos a...
I wanted query in oracle sql syntax.
 
Is this answer useful? Yes | No
January 17, 2007 12:49:17   
Vinayak        

RE: Write a query to find the list of employees whos a...
Select ename
from emp
where trunc(sysdate-emp.dob) > 30
/


 
Is this answer useful? Yes | No
February 12, 2007 01:58:31   
ggk.krishna        

RE: Write a query to find the list of employees whos a...
Hai SELECT ENAME FROM EMPWHERE ROUND(MONTHS_BETWEEN(SYSDATE EMP_DOB)/12)>30I think this will work for you. If not give reply.
 
Is this answer useful? Yes | No
March 12, 2007 05:21:33   
Srikanth        

RE: Write a query to find the list of employees whos a...

select FNAME MNAME LNAME BDATE

FROM EMPLOYEE

WHERE age>30;

 
Is this answer useful? Yes | No
March 16, 2007 22:03:16   
tomtwj Member Since: March 2007   Contribution: 3    

RE: Write a query to find the list of employees whos a...
select empno BIRTHDate
from scott.emp
where trunc( sysdate 'YEAR') - trunC( BIRTHDate 'YEAR') > 30

 
Is this answer useful? Yes | No
May 06, 2007 05:58:54   
Lavanya Chowdary        

RE: Write a query to find the list of employees whos a...
For example if emp table has dob (date of birth) column the query is
SELECT * FROM EMP
WHERE months_between(sysdate dob)/12>30;

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape