blob: b13e087b7d40c0de3244e95d3ac752955841dd74 [file] [log] [blame]
import{_ as s,c as n,b as a,o as l}from"./app-C-fAkKj6.js";const t={};function i(o,e){return l(),n("div",null,e[0]||(e[0]=[a(`<h1 id="identifiers" tabindex="-1"><a class="header-anchor" href="#identifiers"><span>Identifiers</span></a></h1><p>In IoTDB, identifiers are used to represent the names of databases, tables, columns, functions, and other objects.</p><h2 id="_1-naming-rules" tabindex="-1"><a class="header-anchor" href="#_1-naming-rules"><span>1. Naming Rules</span></a></h2><ol><li><strong>Starting Character</strong>: An identifier must begin with a letter.</li><li><strong>Subsequent Characters</strong>: Identifiers can include letters, digits, and underscores.</li><li><strong>Special Characters</strong>: If an identifier contains characters other than letters, digits, and underscores, it must be enclosed in double quotes (<code>&quot;</code>).</li><li><strong>Escape Characters</strong>: In double-quoted identifiers, a double quote character can be represented using two consecutive double quotes (<code>&quot;&quot;</code>).</li></ol><h3 id="_1-1-examples" tabindex="-1"><a class="header-anchor" href="#_1-1-examples"><span>1.1 Examples</span></a></h3><p>Here are some examples of valid identifiers:</p><div class="language-sql line-numbers-mode" data-highlighter="shiki" data-ext="sql" data-title="sql" style="background-color:#282c34;color:#abb2bf;"><pre class="shiki one-dark-pro vp-code"><code><span class="line"><span style="color:#ABB2BF;">test</span></span>
<span class="line"><span style="color:#98C379;">&quot;table$partitions&quot;</span></span>
<span class="line"><span style="color:#98C379;">&quot;identifierWith&quot;</span></span>
<span class="line"><span style="color:#98C379;">&quot;double&quot;</span></span>
<span class="line"><span style="color:#98C379;">&quot;quotes&quot;</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The following are examples of invalid identifiers that must be enclosed in double quotes to be used:</p><div class="language-sql line-numbers-mode" data-highlighter="shiki" data-ext="sql" data-title="sql" style="background-color:#282c34;color:#abb2bf;"><pre class="shiki one-dark-pro vp-code"><code><span class="line"><span style="color:#C678DD;">table</span><span style="color:#ABB2BF;">-</span><span style="color:#C678DD;">name</span><span style="color:#ABB2BF;"> // contains a hyphen</span></span>
<span class="line"><span style="color:#ABB2BF;">123SchemaName // starts </span><span style="color:#C678DD;">with</span><span style="color:#ABB2BF;"> a </span><span style="color:#C678DD;">number</span></span>
<span class="line"><span style="color:#ABB2BF;">colum$</span><span style="color:#C678DD;">name</span><span style="color:#E06C75;">@field</span><span style="color:#ABB2BF;"> // contains special characters </span><span style="color:#C678DD;">and</span><span style="color:#C678DD;"> is</span><span style="color:#C678DD;"> not</span><span style="color:#ABB2BF;"> enclosed </span><span style="color:#C678DD;">in</span><span style="color:#ABB2BF;"> double quotes</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="_2-case-sensitivity" tabindex="-1"><a class="header-anchor" href="#_2-case-sensitivity"><span>2. Case Sensitivity</span></a></h2><p>Identifiers in IoTDB are case-insensitive. The system does not preserve the original case of identifiers during storage, but query results display column names in the same case as specified in the SELECT clause of the query.</p><blockquote><p>Identifiers enclosed in double quotes are also case-insensitive.</p></blockquote><h3 id="_2-1-example" tabindex="-1"><a class="header-anchor" href="#_2-1-example"><span>2.1 Example</span></a></h3><p>Suppose a column named <code>Device_id</code> is created. When inspecting the table schema, it appears as <code>device_id</code>, but query results reflect the column name in the format specified by the user during the query (e.g., <code>Device_ID</code>).</p><div class="language-sql line-numbers-mode" data-highlighter="shiki" data-ext="sql" data-title="sql" style="background-color:#282c34;color:#abb2bf;"><pre class="shiki one-dark-pro vp-code"><code><span class="line"><span style="color:#ABB2BF;">IoTDB</span><span style="color:#56B6C2;">&gt;</span><span style="color:#C678DD;"> create</span><span style="color:#C678DD;"> table</span><span style="color:#ABB2BF;"> table1(Device_id STRING TAG, Model STRING ATTRIBUTE, TemPerature </span><span style="color:#C678DD;">FLOAT</span><span style="color:#ABB2BF;"> FIELD, Humidity DOUBLE FIELD)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#ABB2BF;">IoTDB</span><span style="color:#56B6C2;">&gt;</span><span style="color:#C678DD;"> desc</span><span style="color:#ABB2BF;"> table1;</span></span>
<span class="line"><span style="color:#ABB2BF;">+</span><span style="color:#7F848E;font-style:italic;">-----------+---------+-----------+</span></span>
<span class="line"><span style="color:#ABB2BF;">| ColumnName| DataType| Category|</span></span>
<span class="line"><span style="color:#ABB2BF;">+</span><span style="color:#7F848E;font-style:italic;">-----------+---------+-----------+</span></span>
<span class="line"><span style="color:#ABB2BF;">| </span><span style="color:#C678DD;">time</span><span style="color:#ABB2BF;">|</span><span style="color:#C678DD;">TIMESTAMP</span><span style="color:#ABB2BF;">| </span><span style="color:#C678DD;">TIME</span><span style="color:#ABB2BF;">|</span></span>
<span class="line"><span style="color:#ABB2BF;">| device_id| STRING| TAG|</span></span>
<span class="line"><span style="color:#ABB2BF;">| model| STRING| ATTRIBUTE|</span></span>
<span class="line"><span style="color:#ABB2BF;">|temperature| </span><span style="color:#C678DD;">FLOAT</span><span style="color:#ABB2BF;">| FIELD|</span></span>
<span class="line"><span style="color:#ABB2BF;">| humidity| DOUBLE| FIELD|</span></span>
<span class="line"><span style="color:#ABB2BF;">+</span><span style="color:#7F848E;font-style:italic;">-----------+---------+-----------+</span></span>
<span class="line"></span>
<span class="line"><span style="color:#ABB2BF;">IoTDB</span><span style="color:#56B6C2;">&gt;</span><span style="color:#C678DD;"> select</span><span style="color:#C678DD;"> TiMe</span><span style="color:#ABB2BF;">, Device_ID, MoDEL, TEMPerature, HUMIdity </span><span style="color:#C678DD;">from</span><span style="color:#ABB2BF;"> table1;</span></span>
<span class="line"><span style="color:#ABB2BF;">+</span><span style="color:#7F848E;font-style:italic;">-----------------------------+---------+------+-----------+--------+</span></span>
<span class="line"><span style="color:#ABB2BF;">| </span><span style="color:#C678DD;">TiMe</span><span style="color:#ABB2BF;">|Device_ID| MoDEL|TEMPerature|HUMIdity|</span></span>
<span class="line"><span style="color:#ABB2BF;">+</span><span style="color:#7F848E;font-style:italic;">-----------------------------+---------+------+-----------+--------+</span></span>
<span class="line"><span style="color:#ABB2BF;">|</span><span style="color:#D19A66;">1970</span><span style="color:#ABB2BF;">-</span><span style="color:#D19A66;">01</span><span style="color:#ABB2BF;">-01T08:</span><span style="color:#D19A66;">00</span><span style="color:#ABB2BF;">:</span><span style="color:#D19A66;">00</span><span style="color:#ABB2BF;">.</span><span style="color:#D19A66;">001</span><span style="color:#ABB2BF;">+</span><span style="color:#D19A66;">08</span><span style="color:#ABB2BF;">:</span><span style="color:#D19A66;">00</span><span style="color:#ABB2BF;">| d1|modelY| </span><span style="color:#D19A66;">27</span><span style="color:#ABB2BF;">.</span><span style="color:#D19A66;">2</span><span style="color:#ABB2BF;">| </span><span style="color:#D19A66;">67</span><span style="color:#ABB2BF;">.</span><span style="color:#D19A66;">0</span><span style="color:#ABB2BF;">|</span></span>
<span class="line"><span style="color:#ABB2BF;">+</span><span style="color:#7F848E;font-style:italic;">-----------------------------+---------+------+-----------+--------+</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div>`,15)]))}const p=s(t,[["render",i],["__file","Identifier.html.vue"]]),c=JSON.parse('{"path":"/UserGuide/latest-Table/SQL-Manual/Identifier.html","title":"Identifiers","lang":"en-US","frontmatter":{"description":"Identifiers In IoTDB, identifiers are used to represent the names of databases, tables, columns, functions, and other objects. 1. Naming Rules Starting Character: An identifier ...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://iotdb.apache.org/zh/UserGuide/latest-Table/SQL-Manual/Identifier.html"}],["meta",{"property":"og:url","content":"https://iotdb.apache.org/UserGuide/latest-Table/SQL-Manual/Identifier.html"}],["meta",{"property":"og:site_name","content":"IoTDB Website"}],["meta",{"property":"og:title","content":"Identifiers"}],["meta",{"property":"og:description","content":"Identifiers In IoTDB, identifiers are used to represent the names of databases, tables, columns, functions, and other objects. 1. Naming Rules Starting Character: An identifier ..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2025-02-28T08:05:13.000Z"}],["meta",{"property":"article:modified_time","content":"2025-02-28T08:05:13.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Identifiers\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2025-02-28T08:05:13.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"1. Naming Rules","slug":"_1-naming-rules","link":"#_1-naming-rules","children":[{"level":3,"title":"1.1 Examples","slug":"_1-1-examples","link":"#_1-1-examples","children":[]}]},{"level":2,"title":"2. Case Sensitivity","slug":"_2-case-sensitivity","link":"#_2-case-sensitivity","children":[{"level":3,"title":"2.1 Example","slug":"_2-1-example","link":"#_2-1-example","children":[]}]}],"git":{"createdTime":1735900165000,"updatedTime":1740729913000,"contributors":[{"name":"W1y1r","username":"W1y1r","email":"150988475+W1y1r@users.noreply.github.com","commits":3,"url":"https://github.com/W1y1r"},{"name":"CritasWang","username":"CritasWang","email":"critas@outlook.com","commits":1,"url":"https://github.com/CritasWang"},{"name":"leto-b","username":"leto-b","email":"bingqian.bai@timecho.com","commits":1,"url":"https://github.com/leto-b"}]},"readingTime":{"minutes":1.35,"words":406},"filePathRelative":"UserGuide/latest-Table/SQL-Manual/Identifier.md","localizedDate":"January 3, 2025","autoDesc":true}');export{p as comp,c as data};