MIN and MAX Functions | Easy SQL Tutorial

Pubblicato il: 23 luglio 2023
sul canale di: The SQL Guy
33
0

Here we look at the SQL Functions MAX and MIN. It shows how and when to use them and how to use them both together when combined with GROUP BY.

Content:

00:00 Intro
00:50 What is a SQL function
02:00 The MAX Function
02:40 The MIN Function
03:00 Using them together

Overview of the Max and Min function

The SQL MAX and MIN Functions are known as aggregate functions. These are used to perform a calculation on a set of values. As with all functions, they return a SINGLE value. Thats their job - you ask as question, they provide you with the answer!

What is a Function?

A function is a set of code that has a specific task. They are not able to perform DML statements or change any data, they just perform a calculation and return that value.

In this case you would be asking - what is the maximum value in this result set (MAX) or what is the lowest value in this result set?

Resources

SQL MIN() and MAX() Functions: https://www.w3schools.com/sql/sql_min...

The T-SQL Max Function: https://learn.microsoft.com/en-us/sql...

The T-SQL Min Function: https://learn.microsoft.com/en-us/sql...

SQL Aggregate Functions: https://learn.microsoft.com/en-us/sql...


In questa pagina del sito puoi guardare il video online MIN and MAX Functions | Easy SQL Tutorial della durata di ore minuti seconda in buona qualità , che l'utente ha caricato The SQL Guy 23 luglio 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 33 volte e gli è piaciuto 0 spettatori. Buona visione!