Returns the maximum value in a column or expression.
max(expression)
select max(discount) from salesdetail
-------------------- 62.200000
select discount from salesdetail compute max(discount)
You can use max with exact and approximate numeric, character, and datetime columns; you cannot use it with bit columns. With character columns, max finds the highest value in the collating sequence. max ignores null values. max implicitly converts char datatypes to varchar, and unichar datatypes to univarchar, stripping all trailing blanks.
unichar data is collated according to the default Unicode sort order.
max preserves the trailing zeros in varbinary data.
max returns a varbinary datatype from queries on binary data.
The expression not a column.
The column is not the first column of an index.
There is another aggregate in the query.
There is a group by or where clause.
compute, group by and having clauses, select, where clause in Reference Manual: Commands
For general information about aggregate functions, see Transact-SQL Users Guide.
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute max.