Professional Documents
Culture Documents
4-3
Date Functions
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 2
Date Functions
Displaying Dates
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 3
Date Functions
SYSDATE
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 4
Date Functions
DATE Data Type
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 5
Date Functions
Working with Dates
Examples: Result
SELECT last_name, hire_date + 60 Adds 60 days to
FROM employees; hire_date.
SELECT last_name, (SYSDATE - Displays the number of
hire_date)/7 weeks since the employee
FROM employees; was hired.
SELECT employee_id, (end_date - Finds the number of days
start_date)/365 employee held a job, then
AS "Tenure in last job"
divides by 365 to display
FROM job_history;
in years.
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 6
Date Functions
Date Functions
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 7
Date Functions
Date Functions
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 10
Date Functions
Date Functions
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 9
Date Functions
Date Functions
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 10
Date Functions
Date Functions
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 11
Date Functions
Date Functions
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 12
Date Functions
Date Functions
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 13
Date Functions
Date Functions
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 14
Date Functions
Date Functions
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 15
Date Functions
Summary
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 16
Date Functions
Summary
DPS4L3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 20
Date Functions