Preamble
The Oracle/PLSQL EXTRACT function extracts a value from a date or interval value.
Oracle/PLSQL syntax of EXTRACT function
EXTRACT (
{ YEAR | MONTH | DAY | HOUR | MINUTE | SECOND }
| { TIMEZONE_HOUR | TIMEZONE_MINUTE }
| { TIMEZONE_REGION | TIMEZONE_ABBR }
FROM { date_value | interval_value } )
The EXTRACT function returns a numeric value when the following parameters are provided: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, TIMEZONE_HOUR, TIMEZONE_MINUTE, TIMEZONE_REGION, TIMEZONE_MINUTE.
- Function EXTRACT returns VARCHAR2 when parameters TIMEZONE_REGION or TIMEZONE_ABBR are provided (because time zone name or abbreviation information is returned).
- You can only extract YEAR, MONTH, and DAY from the date.
- You can only extract TIMEZONE_HOUR and TIMEZONE_MINUTE from date/time with time zone data type.
EXTRACT function can be used in the following versions of Oracle/PLSQL
|
Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i
|
Let’s consider some examples of EXTRACT function and learn how to use EXTRACT function in Oracle.
SELECT EXTRACT (YEAR FROM DATE '2019-08-22') FROM DUAL;
--Result: 2019
SELECT EXTRACT (MONTH FROM DATE '2019-08-22') FROM DUAL;
--Result: 8
SELECT EXTRACT (DAY FROM DATE '2019-08-22') FROM DUAL;
--Result: 22
SQL: Extract function
About Enteros
Enteros offers a patented database performance management SaaS platform. It proactively identifies root causes of complex business-impacting database scalability and performance issues across a growing number of clouds, RDBMS, NoSQL, and machine learning database platforms.
The views expressed on this blog are those of the author and do not necessarily reflect the opinions of Enteros Inc. This blog may contain links to the content of third-party sites. By providing such links, Enteros Inc. does not adopt, guarantee, approve, or endorse the information, views, or products available on such sites.
Are you interested in writing for Enteros’ Blog? Please send us a pitch!
RELATED POSTS
Optimizing Cloud Formation and Storage Efficiency in Technology with Enteros: AIOps and FinOps in Action
- 22 October 2025
- Database Performance Management
Introduction The technology sector is undergoing a cloud revolution. Every enterprise — from SaaS startups to global tech giants — is shifting workloads to the cloud to gain agility, scalability, and cost efficiency. However, as cloud infrastructures expand, managing and optimizing their performance becomes increasingly complex. Cloud Formation, Storage Buckets, and multi-cloud architectures have unlocked … Continue reading “Optimizing Cloud Formation and Storage Efficiency in Technology with Enteros: AIOps and FinOps in Action”
Forecasting Cost and Boosting RevOps Efficiency in Insurance with Enteros: AI SQL and Intelligent Resource Group Management
Introduction The insurance industry is at a pivotal moment. As data complexity surges and digital transformation accelerates, insurers are under immense pressure to manage operational costs, improve forecasting accuracy, and optimize their revenue operations (RevOps) efficiently. Traditional systems—burdened with siloed data, limited visibility, and reactive performance monitoring—can no longer keep up with modern scalability and … Continue reading “Forecasting Cost and Boosting RevOps Efficiency in Insurance with Enteros: AI SQL and Intelligent Resource Group Management”
When Payments Stall: The 300ms That Cost Millions
In fintech, milliseconds matter.A single delay in a payment authorization chain can quietly drain millions from a company’s bottom line — not through fraud or failure, but through latency. Most customers never notice 300 milliseconds. But for digital payment systems, that pause can mean the difference between a successful transaction and a lost customer. ⚡ … Continue reading “When Payments Stall: The 300ms That Cost Millions”
Reimagining Financial Operations with Enteros: SaaS Database Performance Management and AI-Driven AIOps for the Future of Finance
- 21 October 2025
- Database Performance Management
Introduction The financial industry has long been at the forefront of digital transformation — from electronic trading systems and mobile banking to blockchain-driven settlements and predictive risk models. Yet, in this high-stakes environment where milliseconds can mean millions, database performance and operational efficiency are more critical than ever. Financial organizations must balance stringent compliance, security, … Continue reading “Reimagining Financial Operations with Enteros: SaaS Database Performance Management and AI-Driven AIOps for the Future of Finance”