例 - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL日付と時刻の関数および式

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
2019年3月
Language
日本語
Last Update
2019-10-29
dita:mapPath
ja-JP/pxz1544241488545.ditamap
dita:ditavalPath
ja-JP/pxz1544241488545.ditaval
dita:id
B035-1211
Product Category
Software
Teradata Vantage

使用例:

SELECT HOUR(CURRENT_TIMESTAMP(6));
SELECT MINUTE(CURTIME());
SELECT SECOND('12:34:25');
sel dayofmonth(current_timestamp);
sel dayofmonth(date '2017-08-21');
sel dayofmonth(timestamp '2017-08-21 16:48:27.770000+00:00');
sel dayofmonth('2017-08-21 16:48:27.770000+00:00' (timestamp));
sel dayofmonth(date '1900-01-01');
sel dayofmonth(date '2018-02-22' - interval '300' year);
sel dayofmonth(date '2018-02-22' - interval '6' month);
sel dayofmonth(date '2018-02-22' - interval '15' day);
sel week(date);
sel week(current_date);
sel week(date '1900-01-01');
sel week(date '1700-05-31');
sel week(date - interval '300' year);
sel week(date - interval '6' month);
sel week(date - interval '150' day);
sel month(date);
sel month(current_date);
sel month(date '1900-01-01');
sel month(date '1899-12-31');
sel month(date '1700-05-31');
sel month(date - interval '300' year);
sel month(date - interval '6' month);
sel month(date - interval '150' day);
sel year(date);
sel year(current_date);
sel year(date '1900-01-01');
sel yearmonth(date '1899-12-31');
sel year(date - interval '300' year);
sel year(date - interval '6' month);