MIN() and MAX() Functions in Oracle SQL | Oracle SQL Tutorials -13

Hi,

I will explain MIN() and MAX() Functions in Oracle SQL in this post of Oracle SQL Tutorial series.

Read the previous post of this tutorial series before this.

SQL SELECT Statement and DESC Command in Oracle SQL | Oracle SQL Tutorials -2

 

The MIN() function

You can find the smallest value of the selected column using the MIN() function.

 

MIN() Syntax

MIN() Function syntax is as follows.

 

SELECT MIN(column_name) FROM table_name;
SELECT MIN(column_name) FROM table_name
WHERE condition;
MIN Function examples are as follows.
SQL> select min(salary) from hr.employees;

MIN(SALARY)
-----------
3100

SQL>
SQL> select min(salary) from hr.employees where department_id>100;

MIN(SALARY)
-----------
9300

SQL>

 

 

 

The MAX() function

You can find the Largest value of the selected column using the MAX() function.

 

MAX() Syntax

MAX() Function syntax is as follows.

 

SELECT MAX(column_name) FROM table_name;


SELECT MAX(column_name) FROM table_name
WHERE condition;
MAX Function examples are as follows.

 

SQL> 
SQL> select max(salary) from hr.employees;

MAX(SALARY)
-----------
23000

SQL> 
SQL> 
SQL> select max(salary) from hr.employees where department_id>100;

MAX(SALARY)
-----------
13008

SQL>

 

 

Do you want to learn Oracle SQL Tutorial for Beginners, then read the following articles.

Oracle SQL Tutorials For Beginners – Learn Oracle SQL from scratch with Oracle SQL Online Course

 

Do you want to learn Oracle Database for Beginners, then read the following articles.

Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

Leave a Reply

Your email address will not be published. Required fields are marked *