"if you encounter any errors in SAP, send me a screenshot at pramod@learntosap.com, and I will help you resolve the issue."

SQL MIN() and MAX() Functions Clause

SQL TUTORIALS-

SQL MIN() and MAX() Functions Clause

Introduction-


Trulli Trulli

-✅ SQL MIN() and MAX() functions are aggregate functions used to find the minimum and maximum values in a column...also MIN() function returns the smallest value of the selected column.and MAX() function returns the largest value of the selected column...


Emoji Examples in HTML

🔸 Example Table: Employees

ID Name Department Salary
1 ANNI IT 10000
2 POOJA IT 9000
3 RAJ SALES 5000

✅ MIN() Function:-MIN() function returns the smallest value in a column.



SELECT MIN(salary) AS LowestSalary
FROM employees;



✅ MAX() Function:-MAX() function returns the largest value in a column.



SELECT MAX(salary) AS HighestSalary
FROM employees;



✅ Combined Example:-



SELECT 
  MIN(salary) AS LowestSalary,
  MAX(salary) AS HighestSalary
FROM employees;




Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees

Department MinSalary MaxSalary
IT 9000 10000
SALES 5000 5000

✅ SQL: Use MIN() with GROUP BY and Set Column Alias.



SELECT Salesperson AS Name,
       Region,
       MIN(Amount) AS Min_Sale
FROM Sales
GROUP BY Salesperson, Region;



May Be Like Important Link-

-Chart Of Account-OB13

-Define Plant-OX1

-Chart Of Account-OB13

-Define Financial Statement