# `MAX`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the maximum value of an expression across all input values.

## Syntax

```sql
max(<expression>)
```

## Arguments

### Required

- `<expression>`: An expression of any comparable type.

## Returns

Returns the same type as the argument. Returns NULL if no rows are selected.

## Considerations

- NULL values are ignored in the calculation.
- Works with numeric types, strings, dates, and other comparable types.
- For strings, returns the lexicographically greatest value.

## Examples

### Find Maximum Value

Get the highest price.

```sql
SELECT max(price) AS highest_price
FROM products;
```

### Maximum by Group

Find the maximum value per group.

```sql
SELECT category, max(price) AS max_price
FROM products
GROUP BY category;
```

### Maximum Date

Find the most recent date.

```sql
SELECT max(order_date) AS latest_order
FROM orders;
```

## Related Documentation

- [MIN](/docs/data/data-cloud-query-guide/references/dc-sql-reference/min.md)
- [MAX_BY](/docs/data/data-cloud-query-guide/references/dc-sql-reference/max-by.md)
- [Aggregate Functions](/docs/data/data-cloud-query-guide/references/dc-sql-reference/aggregate.md)
