17.00 - 17.05 - 例: TD_TIMEBUCKET列からのTD_TIMEBUCKET値の取得 - 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 ocean_buoys(buoyid integer, salinity integer, temperature integer)
PRIMARY TIME INDEX(TIMESTAMP(6), DATE '2016-04-19', HOURS(1));
 
-- The following two adjcent SELECT statements should return the same output:
SELECT td_gettimebucket(td_timecode) from ocean_buoys;
SELECT td_gettimebucket(ocean_buoys.td_timecode) from ocean_buoys;
 
TD_GETTIMEBUCKET(TD_TIMECODE)
-----------------------------
289
  
 
-- The column title contains TIMEBUCKET_COL.
SELECT td_gettimebucket(ocean_buoys.td_timecode) as TimeBucket_COL from ocean_buoys;
 
TIMEBUCKET_COL
--------------
           289
 
SELECT buoyid FROM ocean_buoys WHERE td_gettimebucket(td_timecode) > 200;
 
BUOYID
------
   101