DAY_FLOOR
デスクリプション
日付を指定された時間間隔期間の最も近いタイムスタンプに切り下げます。
Syntax
DAY_FLOOR(<datetime>)
DAY_FLOOR(<datetime>, <origin>)
DAY_FLOOR(<datetime>, <period>)
DAY_FLOOR(<datetime>, <period>, <origin>)
パラメータ
| Parameter | デスクリプション |
|---|---|
<datetime> | 有効な日付式 |
<period> | 各期間を構成する日数を指定する |
<origin> | 時間の開始点。指定されない場合、デフォルトは0001-01-01T00:00:00 |
Return Value
最も近い切り上げされたタイムスタンプの日付を返す。
Examples
select day_floor("2023-07-13 22:28:18", 5);
+------------------------------------------------------------+
| day_floor(cast('2023-07-13 22:28:18' as DATETIMEV2(0)), 5) |
+------------------------------------------------------------+
| 2023-07-12 00:00:00 |
+------------------------------------------------------------+