Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2013
    Posts
    41

    Unanswered: How to find Lenght using PL/SQL function ?

    I've created one PL/SQL age function. Here is a brief demo of it's working.

    Code:
    SELECT AGE('01-JAN-1990')
    FROM DUAL;
    
    The output is as follows:
    
    AGE('01-JAN-1990')
    ________________
                       23.34
    Now I want to run the following query:

    List the names and length of service of all employees in the emp table. Use the age function to determine the length of service.

    EMP table is as follows:

    Code:
    EMP
    
    EMPNO, ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO

    How can I achieve length of service using the age function, any idea?

    Please help !

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Select ename,age(hiredate) from emp;
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Apr 2013
    Posts
    41
    Quote Originally Posted by anacedent View Post
    Select ename,age(hiredate) from emp;
    Awesome, Thanks !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •