17.00 - 17.05 - 例: TD_TIMECODE列とTD_SEQNO列の有効な値の範囲の取得 - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - 時系列テーブルと操作の概要

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
17.05
Release Date
2020年6月
Content Type
プログラミング リファレンス
Publication ID
B035-1208-170K-JPN
Language
日本語 (日本)
Create table MyDB.ocean_buoy (
TD_TIMEBUCKET BIGINT NOT NULL GENERATED SYSTEM TIMECOLUMN,
TD_TIMECODE TIMESTAMP(6) NOT NULL GENERATED TIMECOLUMN,
TD_SEQNO INTEGER NOT NULL GENERATED TIMECOLUMN,
BuoyID INTEGER,
Temperature INTEGER NOT NULL)
PRIMARY TIME INDEX (TIMESTAMP(6), DATE '2016-01-01', HOURS(1), SEQUENCED);
 
exec DBC.TD_TIMESERIES_RANGE('MyDB.ocean_buoy');
 
TD_TIMECODE_RANGE 
----------------------------------------------------                                                                                        
TD_TIMECODE  BETWEEN TIMESTAMP '2016-01-0100:00:00.000000+00:00' AND
TIMESTAMP '2030-08-1214:23:21.842737+00:00'
                                                                                                          
TD_SEQNO_RANGE 
----------------------------------------------------  
TD_SEQNO  BETWEEN 1  AND 20000
 
-- you can specify the table name in the macro and will get the same output as above example.
 
exec DBC.TD_TIMESERIES_RANGE('ocean_buoy');