TDengine SQL
TDengine SQL is the major interface for users to write data into or query from TDengine. It uses standard SQL syntax and includes extensions and optimizations for time-series data and services. The maximum length of a TDengine SQL statement is 1 MB. Note that keyword abbreviations are not supported. For example, DELETE cannot be entered as DEL.
Syntax Specifications used in this chapter:
- Keywords are given in uppercase, although SQL is not case-sensitive.
- means optional input, excluding [] itself.
- … means the item prior to it can be repeated multiple times.
To better demonstrate the syntax, usage and rules of TDengine SQL, hereinafter it’s assumed that there is a data set of data from electric meters. Each meter collects 3 data measurements: current, voltage, phase. The data model is shown below:
The data set includes the data collected by 4 meters, the corresponding table name is d1001, d1002, d1003 and d1004 based on the data model of TDengine.
📄️ FunctionsSingle Row Functions
📄️ OperatorsArithmetic Operators
📄️ Name and Size LimitsNaming Rules
📄️ Access ControlManage user and user’s permission
📄️ Changes in TDengine 3.0This document explains how TDengine SQL has changed in version 3.0.