Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Experience - Date Calculator

User_6Q33BDec 7 2022

Hi,
I am trying to calculate the experience by subtracting current_date minus hiredate from emp table this way.
select * from emp where current_date - hiredate > 39;
However, this is returning all the records in the table irrespective of any value given.
I am not sure if the logic is correct or not but syntactically it isn't showing any error.

  1. Help me understand why is it returning all the records every time
  2. If above logic is invalid, Give me the correct query to fetch the records.
    Table name: emp
    !@mathguy
This post has been answered by Frank Kulash on Dec 7 2022
Jump to Answer
Comments
Post Details
Added on Dec 7 2022
2 comments
369 views