T-SQL MAX Function

 

MAX returns NULL when there is no row to select.

MAX ignores any null values.

For more details see https://learn.microsoft.com/en-us/sql/t-sql/functions/max-transact-sql?source=recommendations&view=sql-server-ver16