- during a operation (
dynamic timestamp
)
Create a column during table creation. For more information, refer to the CREATE TABLE section.
Creates a designated timestamp column in the result of a query.
The output query must be ordered by time. TIMESTAMP()
does not check for order and using timestamp functions on unordered data may produce unexpected results.
:::
:::tip
Dynamic timestamp allows to perform time series operations such as , SAMPLE BY
or LATEST BY
on tables which do not have a .
Examples
The following creates a table with designated timestamp.
The following will query a table and assign a to the output. Note the use of brackets to ensure the timestamp clause is applied to the result of the query instead of the whole readings
table.
Although the readings
table does not have a designated timestamp, we are able to create one on the fly. Now, we can use this into a subquery to perform timestamp operations.
If the data is unordered, it is important to order it first.