MAXIMUM Function Examples | Teradata Vantage - Examples: Using the MAXIMUM Function - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
Product Category
Teradata Vantageā„¢

Example: CHARACTER Data

The following SELECT returns the immediately following result.

SELECT MAX(Name) 
FROM Employee; 

Result:

Maximum(Name)
-------------
Zorn J

Example: Column Expressions

You want to know which item in your warehouse stock has the maximum cost of sales.

SELECT MAX(CostOfSales) AS m, ProdID 
FROM Inventory
GROUP BY ProdID
ORDER BY m DESC;
   
Maximum(CostOfSales)  ProdID
--------------------  ------
                1295    3815
                 975    4400
                 950    4120

For time series examples, see Teradata Vantageā„¢ - Time Series Tables and Operations, B035-1208.