Query a Row Using Native Object Store | NOS | Teradata Vantage - 17.05 - Querying for a Specific Set of Rows - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Native Object Store Getting Started Guide

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1214-175K
Language
English (United States)

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_json. See Setting Up to Run JSON Examples.
  3. Query for a set of rows by specifying a specific value for the site_no attribute in the command’s WHERE clause. This requests that only records with that value be returned for viewing. In this example, the max value for the Flow attribute for a single site_no is returned.
    SELECT MAX(CAST(payload.Flow AS FLOAT) ( FORMAT '-ZZZZ9.99'))
      FROM riverflow_json
      WHERE payload.site_no = '09394500';

    Result:

    Maximum(Payload.Flow)
    ---------------------
                  1230.00