カレンダ データのクエリーの例 - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ データ ディクショナリ

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

曜日(day_of_week)と週の始まりの日付(weekBegin)を特定できる単純な問合わせの例を以下に示します。セッション カレンダは、ISOとCOMPATIBLEのシステム定義カレンダです。

  • 最初の2つの例は、特定の日付の曜日(曜日1、2、7など)を返すために使用できるクエリーです。
  • 最後の2つの例は、特定の日付が属す週の初日(曜日1)の日付を返すために使用できるクエリーです。

例: 曜日(ISOカレンダ)

Sel day_of_week from Sys_Calendar.Calendar where calendar_date = date '2011-01-01';
day_of_week
-----------
6

例: 曜日(COMPATIBLEカレンダ)

Sel day_of_week from Sys_Calendar.Calendar where calendar_date = date '2011-01-01';
day_of_week
-----------
1

例: 週の始まり(ISOカレンダ)

Sel weekBegin from Sys_Calendar.BusinessCalendar where calendar_date = date '2011-01-01';
WeekBegin
-----------
10/12/27

例: 週の始まり(COMPATIBLEカレンダ)

Sel weekBegin from Sys_Calendar.BusinessCalendar where calendar_date = date '2011-01-01';
WeekBegin
-----------
11/01/01