SINCE...UNTIL Clause
Use the SINCE...UNTIL clause on a time range in a query. If the UNTIL portion is omitted, the query matches all the events that occurred after the time specified in the SINCEportion. A query can contain both a SINCE...UNTIL clause and a WHERE clause. In such cases, the WHERE argument comes before SINCE... UNTIL and is applied in that order. The time range specified in the clause overrides any other time limits applied to the query, including the time range selection in the UI.
構文
SINCE timevalue [UNTIL timevalue]
ここで、timevalue は整数と時間単位(オプション)を組み合わせたものです。timevalue が省略されている場合、値は Unix エポックタイムスタンプとしてミリ秒単位で解釈されます。
| 単位記号 | 説明 |
|---|---|
| [m | minute | minutes] | 分 |
| [h | hour | hours] | 時間 |
| [d | day | days] | day |
| [w | week | weeks] | 週(7 日) |
例
| クエリ | 結果 |
|---|---|
| SELECT * FROM transactions SINCE 1 h UNTIL 15 m | 1 時間 ~ 15 分前に発生したすべてのトランザクション |
| SELECT * FROM transactions SINCE 1 h | 1 時間前に発生したすべてのトランザクション |
| SELECT * FROM transactions SINCE 1502147143000 UNTIL 1502148043000 | Unix タイムスタンプ 1502147143000 ~ 1502148043000 間で発生したすべてのトランザクション |