blob: 033011c4e39bf60c53bb9d1223e98f9123522dd3 [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[80],{647:function(t,e,a){"use strict";a.r(e);var n=a(70),i=Object(n.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"data-concept"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-concept"}},[t._v("#")]),t._v(" Data Concept")]),t._v(" "),a("h2",{attrs:{id:"data-model"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-model"}},[t._v("#")]),t._v(" Data Model")]),t._v(" "),a("p",[t._v("A wind power IoT scenario is taken as an example to illustrate how to creat a correct data model in IoTDB.")]),t._v(" "),a("p",[t._v('According to the enterprise organization structure and equipment entity hierarchy, it is expressed as an attribute hierarchy structure, as shown below. The hierarchical from top to bottom is: power group layer - power plant layer - entity layer - measurement layer. ROOT is the root node, and each node of measurement layer is a leaf node. In the process of using IoTDB, the attributes on the path from ROOT node is directly connected to each leaf node with ".", thus forming the name of a timeseries in IoTDB. For example, The left-most path in Figure 2.1 can generate a timeseries named '),a("code",[t._v("root.ln.wf01.wt01.status")]),t._v(".")]),t._v(" "),a("center",[a("img",{staticStyle:{width:"100%","max-width":"800px","max-height":"600px","margin-left":"auto","margin-right":"auto",display:"block"},attrs:{src:"https://user-images.githubusercontent.com/19167280/122668849-b1c69280-d1ec-11eb-83cb-3b73c40bdf72.png"}})]),t._v(" "),a("p",[t._v("Here are the basic concepts of the model involved in IoTDB:")]),t._v(" "),a("ul",[a("li",[t._v("Measurement (Also called field)")])]),t._v(" "),a("p",[a("strong",[t._v("Univariable or multi-variable measurement")]),t._v(". It is information measured by a detection equipment in an actual scene, and can transform the sensed information into an electrical signal or other desired form of information output and send it to IoTDB. In IoTDB, all data and paths stored are organized in units of measuements.")]),t._v(" "),a("ul",[a("li",[t._v("Sub-measurement")])]),t._v(" "),a("p",[t._v("In multi-variable measurements, there are many sub-measurement. For example, GPS is a multi-variable measurements, including three sub-measurement: longitude, dimension and altitude. Multi-variable measurements are usually collected at the same time and share time series.")]),t._v(" "),a("p",[t._v("The univariable measurement overlaps the sub-measurement name with the measurement name. For example, temperature is a univariable measurement.")]),t._v(" "),a("ul",[a("li",[t._v("Entity (Also called device)")])]),t._v(" "),a("p",[a("strong",[t._v("An entity")]),t._v(" is an equipped with measurements in real scenarios. In IoTDB, all measurements should have their corresponding entities.")]),t._v(" "),a("ul",[a("li",[t._v("Storage Group")])]),t._v(" "),a("p",[a("strong",[t._v("A group of entities.")]),t._v(" Users can set any prefix path as a storage group. Provided that there are four timeseries "),a("code",[t._v("root.ln.wf01.wt01.status")]),t._v(", "),a("code",[t._v("root.ln.wf01.wt01.temperature")]),t._v(", "),a("code",[t._v("root.ln.wf02.wt02.hardware")]),t._v(", "),a("code",[t._v("root.ln.wf02.wt02.status")]),t._v(", two devices "),a("code",[t._v("wt01")]),t._v(", "),a("code",[t._v("wt02")]),t._v(" under the path "),a("code",[t._v("root.ln")]),t._v(" may belong to the same owner or the same manufacturer, so d1 and d2 are closely related. At this point, the prefix path root.vehicle can be designated as a storage group, which will enable IoTDB to store all devices under it in the same folder. Newly added devices under "),a("code",[t._v("root.ln")]),t._v(" will also belong to this storage group.")]),t._v(" "),a("blockquote",[a("p",[t._v("Note1: A full path ("),a("code",[t._v("root.ln.wf01.wt01.status")]),t._v(" as in the above example) is not allowed to be set as a storage group.")]),t._v(" "),a("p",[t._v("Note2: The prefix of a timeseries must belong to a storage group. Before creating a timeseries, users must set which storage group the series belongs to. Only timeseries whose storage group is set can be persisted to disk.")])]),t._v(" "),a("p",[t._v("Once a prefix path is set as a storage group, the storage group settings cannot be changed.")]),t._v(" "),a("p",[t._v("After a storage group is set, the ancestral layers, children and descendant layers of the corresponding prefix path are not allowed to be set up again (for example, after "),a("code",[t._v("root.ln")]),t._v(" is set as the storage group, the root layer and "),a("code",[t._v("root.ln.wf01")]),t._v(" are not allowed to be set as storage groups).")]),t._v(" "),a("p",[t._v("The Layer Name of storage group can only consist of characters, numbers, underscores and hyphen, like "),a("code",[t._v("root.storagegroup_1-sg1")]),t._v(".")]),t._v(" "),a("ul",[a("li",[t._v("Data point")])]),t._v(" "),a("p",[a("strong",[t._v('A "time-value" pair')]),t._v(".")]),t._v(" "),a("ul",[a("li",[t._v("Timeseries (A measurement of an entity corresponds to a timeseries. Also called meter, timeline, and tag, parameter in real time database)")])]),t._v(" "),a("p",[a("strong",[t._v("The record of a measurement of an entity on the time axis.")]),t._v(" Timeseries is a series of data points.")]),t._v(" "),a("p",[t._v("For example, if entity wt01 in power plant wf01 of power group ln has a measurement named status, its timeseries can be expressed as: "),a("code",[t._v("root.ln.wf01.wt01.status")]),t._v(".")]),t._v(" "),a("ul",[a("li",[t._v("Multi-variable timeseries (Also called aligned timeseries, from v0.13)")])]),t._v(" "),a("p",[t._v("A multi-variable measurements of an entity corresponds to a multi-variable timeseries. These timeseries are called "),a("strong",[t._v("multi-variable timeseries")]),t._v(", also called "),a("strong",[t._v("aligned timeseries")]),t._v(".")]),t._v(" "),a("p",[t._v("Multi-variable timeseries need to be created, inserted and deleted at the same time. However, when querying, you can query each sub-measurement separately.")]),t._v(" "),a("p",[t._v("By using multi-variable timeseries, the timestamp columns of a group of multi-variable timeseries need to be stored only once in memory and disk when inserting data, instead of once per timeseries:")]),t._v(" "),a("img",{staticStyle:{width:"100%","max-width":"800px","max-height":"600px","margin-left":"auto","margin-right":"auto",display:"block"},attrs:{src:"https://user-images.githubusercontent.com/19167280/114125919-f4850800-9929-11eb-8211-81d4c04af1ec.png"}}),t._v(" "),a("p",[t._v("In the following chapters of data definition language, data operation language and Java Native Interface, various operations related to multi-variable timeseries will be introduced one by one.")]),t._v(" "),a("ul",[a("li",[t._v("Measurement template (From v0.13)")])]),t._v(" "),a("p",[t._v("In the actual scenario, many entities collect the same measurements, that is, they have the same measurements name and type. A "),a("strong",[t._v("measurement template")]),t._v(" can be declared to define the collectable measurements set. Measurement template is hung on any node of the tree data pattern, which means that all entities under the node have the same measurements set.")]),t._v(" "),a("p",[t._v("Currently you can only set one "),a("strong",[t._v("measurement template")]),t._v(" on a specific path. An entity will use it's own measurement template or nearest ancestor's measurement template.")]),t._v(" "),a("p",[t._v("In the following chapters of data definition language, data operation language and Java Native Interface, various operations related to measurement template will be introduced one by one.")]),t._v(" "),a("ul",[a("li",[t._v("Path")])]),t._v(" "),a("p",[t._v("In IoTDB, a path is an expression that conforms to the following constraints:")]),t._v(" "),a("div",{staticClass:"language- line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("path: LayerName (DOT LayerName)+\nLayerName: Identifier | STAR\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br")])]),a("p",[t._v('Among them, STAR is "*" and DOT is ".".')]),t._v(" "),a("p",[t._v('We call the middle part of a path between two "." as a layer, and thus '),a("code",[t._v("root.A.B.C")]),t._v(" is a path with four layers.")]),t._v(" "),a("p",[t._v("It is worth noting that in the path, root is a reserved character, which is only allowed to appear at the beginning of the time series mentioned below. If root appears in other layers, it cannot be parsed and an error is reported.")]),t._v(" "),a("p",[t._v('Single quotes are not allowed in the path. If you want to use special characters such as "." in LayerName, use double quotes. For example, '),a("code",[t._v('root.sg."d.1"."s.1"')]),t._v(".")]),t._v(" "),a("p",[t._v("The characters supported in LayerName without double quotes are as below:")]),t._v(" "),a("ul",[a("li",[t._v("Chinese characters '\\u2E80' to '\\u9FFF'")]),t._v(" "),a("li",[t._v("'+', '&', '%', '$', '#', '@', '/', '_', '-', ':'")]),t._v(" "),a("li",[t._v("'A' to 'Z', 'a' to 'z', '0' to '9'")]),t._v(" "),a("li",[t._v("'[', ']' (eg. 's[1', 's[1]', s[ab]')")])]),t._v(" "),a("p",[t._v("'-' and ':' cannot be the first character. '+' cannot use alone.")]),t._v(" "),a("blockquote",[a("p",[t._v("Note: the LayerName of storage group can only be characters, numbers, underscores and hyphen.")]),t._v(" "),a("p",[t._v("Besides, if deploy on Windows system, the LayerName is case-insensitive, which means it's not allowed to set storage groups "),a("code",[t._v("root.ln")]),t._v(" and "),a("code",[t._v("root.LN")]),t._v(" at the same time.")])]),t._v(" "),a("ul",[a("li",[t._v("Prefix Path")])]),t._v(" "),a("p",[t._v("The prefix path refers to the path where the prefix of a timeseries path is located. A prefix path contains all timeseries paths prefixed by the path. For example, suppose that we have three sensors: "),a("code",[t._v("root.vehicle.device1.sensor1")]),t._v(", "),a("code",[t._v("root.vehicle.device1.sensor2")]),t._v(", "),a("code",[t._v("root.vehicle.device2.sensor1")]),t._v(", the prefix path "),a("code",[t._v("root.vehicle.device1")]),t._v(" contains two timeseries paths "),a("code",[t._v("root.vehicle.device1.sensor1")]),t._v(" and "),a("code",[t._v("root.vehicle.device1.sensor2")]),t._v(" while "),a("code",[t._v("root.vehicle.device2.sensor1")]),t._v(" is excluded.")]),t._v(" "),a("ul",[a("li",[t._v("Path With Star")])]),t._v(" "),a("p",[t._v("In order to make it easier and faster to express multiple timeseries paths or prefix paths, IoTDB provides users with the path pith star. "),a("code",[t._v("*")]),t._v(" can appear in any layer of the path. According to the position where "),a("code",[t._v("*")]),t._v(" appears, the path with star can be divided into two types:")]),t._v(" "),a("p",[a("code",[t._v("*")]),t._v(" appears at the end of the path;")]),t._v(" "),a("p",[a("code",[t._v("*")]),t._v(" appears in the middle of the path;")]),t._v(" "),a("p",[t._v("When "),a("code",[t._v("*")]),t._v(" appears at the end of the path, it represents ("),a("code",[t._v("*")]),t._v(")+, which is one or more layers of "),a("code",[t._v("*")]),t._v(". For example, "),a("code",[t._v("root.vehicle.device1.*")]),t._v(" represents all paths prefixed by "),a("code",[t._v("root.vehicle.device1")]),t._v(" with layers greater than or equal to 4, like "),a("code",[t._v("root.vehicle.device1.*")]),t._v(", "),a("code",[t._v("root.vehicle.device1.*.*")]),t._v(", "),a("code",[t._v("root.vehicle.device1.*.*.*")]),t._v(", etc.")]),t._v(" "),a("p",[t._v("When "),a("code",[t._v("*")]),t._v(" appears in the middle of the path, it represents "),a("code",[t._v("*")]),t._v(" itself, i.e., a layer. For example, "),a("code",[t._v("root.vehicle.*.sensor1")]),t._v(" represents a 4-layer path which is prefixed with "),a("code",[t._v("root.vehicle")]),t._v(" and suffixed with "),a("code",[t._v("sensor1")]),t._v(".")]),t._v(" "),a("blockquote",[a("p",[t._v("Note1: "),a("code",[t._v("*")]),t._v(" cannot be placed at the beginning of the path.")])]),t._v(" "),a("blockquote",[a("p",[t._v("Note2: A path with "),a("code",[t._v("*")]),t._v(" at the end has the same meaning as a prefix path, e.g., "),a("code",[t._v("root.vehicle.*")]),t._v(" and "),a("code",[t._v("root.vehicle")]),t._v(" is the same.")])]),t._v(" "),a("ul",[a("li",[t._v("Timestamp")])]),t._v(" "),a("p",[t._v("The timestamp is the time point at which data is produced. It includes absolute timestamps and relative timestamps")]),t._v(" "),a("ul",[a("li",[t._v("Absolute timestamp")])]),t._v(" "),a("p",[t._v("Absolute timestamps in IoTDB are divided into two types: LONG and DATETIME (including DATETIME-INPUT and DATETIME-DISPLAY). When a user inputs a timestamp, he can use a LONG type timestamp or a DATETIME-INPUT type timestamp, and the supported formats of the DATETIME-INPUT type timestamp are shown in the table below:")]),t._v(" "),a("center",[t._v("**Supported formats of DATETIME-INPUT type timestamp**\n"),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Format")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy-MM-dd HH:mm:ss")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy/MM/dd HH:mm:ss")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy.MM.dd HH:mm:ss")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy-MM-dd'T'HH:mm:ss")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy/MM/dd'T'HH:mm:ss")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy.MM.dd'T'HH:mm:ss")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy-MM-dd HH:mm:ssZZ")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy/MM/dd HH:mm:ssZZ")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy.MM.dd HH:mm:ssZZ")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy-MM-dd'T'HH:mm:ssZZ")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy/MM/dd'T'HH:mm:ssZZ")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy.MM.dd'T'HH:mm:ssZZ")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy/MM/dd HH:mm:ss.SSS")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy-MM-dd HH:mm:ss.SSS")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy.MM.dd HH:mm:ss.SSS")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy/MM/dd'T'HH:mm:ss.SSS")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy-MM-dd'T'HH:mm:ss.SSS")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy.MM.dd'T'HH:mm:ss.SSS")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy-MM-dd HH:mm:ss.SSSZZ")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy/MM/dd HH:mm:ss.SSSZZ")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy.MM.dd HH:mm:ss.SSSZZ")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy-MM-dd'T'HH:mm:ss.SSSZZ")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy/MM/dd'T'HH:mm:ss.SSSZZ")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("yyyy.MM.dd'T'HH:mm:ss.SSSZZ")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("ISO8601 standard time format")])])])])]),t._v(" "),a("p",[t._v("IoTDB can support LONG types and DATETIME-DISPLAY types when displaying timestamps. The DATETIME-DISPLAY type can support user-defined time formats. The syntax of the custom time format is shown in the table below:")]),t._v(" "),a("center",[t._v("**The syntax of the custom time format**\n"),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Symbol")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Meaning")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Presentation")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Examples")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("G")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("era")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("era")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("era")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("C")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("century of era (>=0)")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("number")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("20")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("year of era (>=0)")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("year")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1996")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}})]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("x")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("weekyear")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("year")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1996")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("w")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("week of weekyear")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("number")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("27")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("e")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("day of week")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("number")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("E")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("day of week")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("text")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Tuesday; Tue")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}})]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("y")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("year")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("year")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1996")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("D")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("day of year")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("number")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("189")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("M")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("month of year")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("month")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("July; Jul; 07")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("d")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("day of month")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("number")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("10")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}})]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("a")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("halfday of day")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("text")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("PM")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("K")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("hour of halfday (0~11)")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("number")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("0")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("h")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("clockhour of halfday (1~12)")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("number")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("12")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}})]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("H")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("hour of day (0~23)")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("number")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("0")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("k")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("clockhour of day (1~24)")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("number")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("24")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("m")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("minute of hour")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("number")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("30")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("s")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("second of minute")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("number")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("55")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("S")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("fraction of second")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("millis")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("978")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}})]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("z")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("time zone")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("text")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Pacific Standard Time; PST")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("Z")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("time zone offset/id")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("zone")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("-0800; -08:00; America/Los_Angeles")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}})]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("'")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("escape for text")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("delimiter")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}})]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("''")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("single quote")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("literal")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("'")])])])])]),t._v(" "),a("ul",[a("li",[t._v("Relative timestamp")])]),t._v(" "),a("p",[t._v("Relative time refers to the time relative to the server time "),a("code",[t._v("now()")]),t._v(" and "),a("code",[t._v("DATETIME")]),t._v(" time.")]),t._v(" "),a("p",[t._v("Syntax:")]),t._v(" "),a("div",{staticClass:"language- line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" Duration = (Digit+ ('Y'|'MO'|'W'|'D'|'H'|'M'|'S'|'MS'|'US'|'NS'))+\n RelativeTime = (now() | DATETIME) ((+|-) Duration)+\n \n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br")])]),t._v(" "),a("center",[t._v("**The syntax of the duration unit**\n"),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Symbol")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Meaning")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Presentation")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Examples")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("y")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("year")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1y=365 days")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1y")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("mo")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("month")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1mo=30 days")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1mo")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("w")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("week")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1w=7 days")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1w")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("d")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("day")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1d=1 day")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1d")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}})]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("h")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("hour")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1h=3600 seconds")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1h")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("m")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("minute")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1m=60 seconds")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1m")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("s")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("second")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1s=1 second")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1s")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}}),t._v(" "),a("td",{staticStyle:{"text-align":"center"}})]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("ms")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("millisecond")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1ms=1000_000 nanoseconds")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1ms")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("us")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("microsecond")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1us=1000 nanoseconds")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1us")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("ns")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("nanosecond")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1ns=1 nanosecond")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1ns")])])])])]),t._v(" "),a("p",[t._v("eg:")]),t._v(" "),a("div",{staticClass:"language- line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("now() - 1d2h //1 day and 2 hours earlier than the current server time\nnow() - 1w //1 week earlier than the current server time\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br")])]),a("blockquote",[a("p",[t._v("Note:There must be spaces on the left and right of '+' and '-'.")])])],1)}),[],!1,null,null,null);e.default=i.exports}}]);