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

select * from emp
where trunc(months_between(sysdate, hiredate))=2;

Is This Answer Correct ?    39 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I need a function for a train ticket reservation please answer it thanks in advance

555


What is sqlite format?

618


what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba

494


What is break?

606


Is stored procedure faster than query?

554






Do we need to rebuild index after truncate?

520


Which is the correct statement about truncate and delete?

517


What is the difference between stored procedure and view?

522


what is the difference between myisam static and myisam dynamic? : Sql dba

573


Why do we use subquery?

477


What is the use of function "module procedure" in pl/sql?

653


What does over partition by mean in sql?

519


Is sql a microsoft product?

487


What are literals in sql server?

520


What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql

522