未验证 提交 81705843 编写于 作者: H hzcheng 提交者: GitHub

Merge pull request #196 from StoneT2000/master

Documentation Update
......@@ -74,7 +74,7 @@ tags (location binary(20), type int)</code></pre>
<p>修改超级表的标签名,从超级表修改某个标签名后,该超级表下的所有子表也会自动更新该标签名。</p>
</li>
<li><p>修改子表的标签值</p>
<pre><code class='language-mysql' lang='mysql'>ALTER TABLE &lt;table_name&gt; SET &lt;tag_name&gt;=&lt;new_tag_value&gt;
<pre><code class='language-mysql' lang='mysql'>ALTER TABLE &lt;table_name&gt; SET TAG &lt;tag_name&gt;=&lt;new_tag_value&gt;
</code></pre>
</li>
......
......@@ -18,7 +18,7 @@
<pre><code class="cmd language-cmd">systemctl start taosd</code></pre>
<p>Then check if the server is working now.</p>
<pre><code class="cmd language-cmd">systemctl status taosd</code></pre>
<p>If the service is running successfully, you can play around though TDengine shell <code>taos</code>, the command line interface tool located in directory /usr/local/bin/taos </p>
<p>If the service is running successfully, you can play around through TDengine shell <code>taos</code>, the command line interface tool located in directory /usr/local/bin/taos </p>
<p><strong>Note: The <em>systemctl</em> command needs the root privilege. Use <em>sudo</em> if you are not the <em>root</em> user.</strong></p>
<a class='anchor' id='TDengine-Shell'></a><h2>TDengine Shell</h2>
<p>To launch TDengine shell, the command line interface, in a Linux terminal, type:</p>
......
......@@ -67,40 +67,31 @@ INTERVAL(10M)</code></pre>
<a class='anchor' id='Management-of-STables'></a><h2>Management of STables</h2>
<p>After you can create a STable, you can describe, delete, change STables. This section lists all the supported operations.</p>
<a class='anchor' id='Show-STables-in-current-DB'></a><h3>Show STables in current DB</h3>
<pre><code class='language-mysql' lang='mysql'>show stables;
</code></pre>
<pre><code class='language-mysql' lang='mysql'>show stables;</code></pre>
<p>It lists all STables in current DB, including the name, created time, number of fileds, number of tags, and number of tables which are created via this STable. </p>
<a class='anchor' id='Describe-a-STable'></a><h3>Describe a STable</h3>
<pre><code class='language-mysql' lang='mysql'>DESCRIBE &lt;stable_name&gt;
</code></pre>
<pre><code class='language-mysql' lang='mysql'>DESCRIBE &lt;stable_name&gt;</code></pre>
<p>It lists the STable&#39;s schema and tags</p>
<a class='anchor' id='Drop-a-STable'></a><h3>Drop a STable</h3>
<pre><code class='language-mysql' lang='mysql'>DROP TABLE &lt;stable_name&gt;
</code></pre>
<pre><code class='language-mysql' lang='mysql'>DROP TABLE &lt;stable_name&gt;</code></pre>
<p>To delete a STable, all the tables created via this STable shall be deleted first, otherwise, it will fail.</p>
<a class='anchor' id='List-the-Associated-Tables-of-a-STable'></a><h3>List the Associated Tables of a STable</h3>
<pre><code class='language-mysql' lang='mysql'>SELECT TBNAME,[TAG_NAME,…] FROM &lt;stable_name&gt; WHERE &lt;tag_name&gt; &lt;[=|=&lt;|&gt;=|&lt;&gt;] values..&gt; ([AND|OR] …)
</code></pre>
<pre><code class='language-mysql' lang='mysql'>SELECT TBNAME,[TAG_NAME,…] FROM &lt;stable_name&gt; WHERE &lt;tag_name&gt; &lt;[=|=&lt;|&gt;=|&lt;&gt;] values..&gt; ([AND|OR] …)</code></pre>
<p>It will list all the tables which satisfy the tag filter conditions. The tables are all created from this specific STable. TBNAME is a new keyword introduced, it is the table name associated with the STable. </p>
<pre><code class='language-mysql' lang='mysql'>SELECT COUNT(TBNAME) FROM &lt;stable_name&gt; WHERE &lt;tag_name&gt; &lt;[=|=&lt;|&gt;=|&lt;&gt;] values..&gt; ([AND|OR] …)
</code></pre>
<pre><code class='language-mysql' lang='mysql'>SELECT COUNT(TBNAME) FROM &lt;stable_name&gt; WHERE &lt;tag_name&gt; &lt;[=|=&lt;|&gt;=|&lt;&gt;] values..&gt; ([AND|OR] …)</code></pre>
<p>The above SQL statement will list the number of tables in a STable, which satisfy the filter condition.</p>
<a class='anchor' id='Management-of-Tags'></a><h2>Management of Tags</h2>
<p>You can add, delete and change the tags for a STable, and you can change the tag value of a table. The SQL commands are listed below. </p>
<a class='anchor' id='Add-a-Tag'></a><h3>Add a Tag</h3>
<pre><code class='language-mysql' lang='mysql'>ALTER TABLE &lt;stable_name&gt; ADD TAG &lt;new_tag_name&gt; &lt;TYPE&gt;
</code></pre>
<pre><code class='language-mysql' lang='mysql'>ALTER TABLE &lt;stable_name&gt; ADD TAG &lt;new_tag_name&gt; &lt;TYPE&gt;</code></pre>
<p>It adds a new tag to the STable with a data type. The maximum number of tags is 6. </p>
<a class='anchor' id='Drop-a-Tag'></a><h3>Drop a Tag</h3>
<pre><code class='language-mysql' lang='mysql'>ALTER TABLE &lt;stable_name&gt; DROP TAG &lt;tag_name&gt;
</code></pre>
<pre><code class='language-mysql' lang='mysql'>ALTER TABLE &lt;stable_name&gt; DROP TAG &lt;tag_name&gt;</code></pre>
<p>It drops a tag from a STable. The first tag could not be deleted, and there must be at least one tag.</p>
<a class='anchor' id='Change-a-Tag&#39;s-Name'></a><h3>Change a Tag&#39;s Name</h3>
<pre><code class='language-mysql' lang='mysql'>ALTER TABLE &lt;stable_name&gt; CHANGE TAG &lt;old_tag_name&gt; &lt;new_tag_name&gt;
</code></pre>
<pre><code class='language-mysql' lang='mysql'>ALTER TABLE &lt;stable_name&gt; CHANGE TAG &lt;old_tag_name&gt; &lt;new_tag_name&gt;</code></pre>
<p>It changes the name of a tag from old to new. </p>
<a class='anchor' id='Change-the-Tag&#39;s-Value'></a><h3>Change the Tag&#39;s Value</h3>
<pre><code class='language-mysql' lang='mysql'>ALTER TABLE &lt;table_name&gt; SET &lt;tag_name&gt;=&lt;new_tag_value&gt;
</code></pre>
<pre><code class='language-mysql' lang='mysql'>ALTER TABLE &lt;table_name&gt; SET TAG &lt;tag_name&gt;=&lt;new_tag_value&gt;</code></pre>
<p>It changes a table&#39;s tag value to a new one. </p>
<a href='../index.html'>Back</a></section></main></div><?php include($s.'/footer.php'); ?><script>$('pre').addClass('prettyprint linenums');PR.prettyPrint()</script><script src='lib/docs/liner.js'></script></body></html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册