Find the MAX and MIN Values | Native Object Store ( NOS ) | Teradata Vantage - Finding Maximum and Minimum Values - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Native Object Store Getting Started Guide

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zws1595641486108.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1214
lifecycle
previous
Product Category
Software
Teradata Vantage

The examples use a sample river flow data set. To use your own data, replace the table and column names, and authorization object. See Variable Substitutions for Examples for the credentials and location values for the sample data set.

  1. To run NOS-related commands, log on to the database as a user with the required privileges.
  2. If it does not exist, create the foreign table or ask your database administrator to create the foreign table called riverflow_csv. See Setting Up to Run CSV Examples.
  3. Run the following command to get the maximum and minimum values for a specific payload attribute, Flow in this example. It executes against the foreign table called riverflow_csv and considers all records contained within the object as specified by the LOCATION clause in the foreign table.
    SELECT MAX(CAST(payload..Flow AS FLOAT) ( FORMAT '-ZZZZ9.99'))
          , MIN(CAST(payload..Flow AS FLOAT) ( FORMAT '-(5)ZZZ9.99'))
     FROM riverflow_csv;

    Your result will be similar to the following:

    Maximum(Payload..Flow)  Minimum(Payload..Flow)
    ----------------------  ----------------------
                  19000.00                   -9.72