doc-exports/docs/dli/sqlreference/dli_08_0105.html
Su, Xiaomeng 76a5b1ee83 dli_sqlreference_20240227
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2024-03-27 22:02:33 +00:00

49 lines
6.1 KiB
HTML

<a name="dli_08_0105"></a><a name="dli_08_0105"></a>
<h1 class="topictitle1">Viewing Table Statistics</h1>
<div id="body8662426"><div class="section" id="dli_08_0105__en-us_topic_0114776199_en-us_topic_0107972084_en-us_topic_0093946811_sb61b4d60d341403f9cf378f85e25d113"><h4 class="sectiontitle">Function</h4><p id="dli_08_0105__en-us_topic_0114776199_en-us_topic_0107972084_en-us_topic_0093946811_a431ed6fb9d824035b2600ec25910426b">This statement is used to view the table statistics. The names and data types of all columns in a specified table will be returned.</p>
</div>
<div class="section" id="dli_08_0105__en-us_topic_0114776199_en-us_topic_0107972084_en-us_topic_0093946811_s12b23206c74c4eb8b8863d8220f6e1f5"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="dli_08_0105__en-us_topic_0114776199_screen1558516372317"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">DESCRIBE</span><span class="w"> </span><span class="p">[</span><span class="n">EXTENDED</span><span class="o">|</span><span class="n">FORMATTED</span><span class="p">]</span><span class="w"> </span><span class="p">[</span><span class="n">db_name</span><span class="p">.]</span><span class="k">table_name</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="dli_08_0105__en-us_topic_0114776199_en-us_topic_0107972084_en-us_topic_0093946811_s85a6f8f752b14c12908d2303d618d510"><h4 class="sectiontitle">Keywords</h4><ul id="dli_08_0105__en-us_topic_0114776199_en-us_topic_0107972084_en-us_topic_0093946811_u6276390c1d994411a3ade99c0da8c0c0"><li id="dli_08_0105__en-us_topic_0114776199_en-us_topic_0107972084_en-us_topic_0093946811_lf20ccaa3b133495591e692c43a7287d9">EXTENDED: displays all metadata of the specified table. It is used during debugging in general.</li><li id="dli_08_0105__en-us_topic_0114776199_en-us_topic_0107972084_en-us_topic_0093946811_lae91afc5a5e84024951de4cb76ee67c9">FORMATTED: displays all metadata of the specified table in a form.</li></ul>
</div>
<div class="section" id="dli_08_0105__en-us_topic_0114776188_en-us_topic_0093946905_s95436b2cebbc4c34b0e6ca8427d4f1d9"><h4 class="sectiontitle">Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_08_0105__en-us_topic_0114776188_en-us_topic_0103084433_t2fa8597e0dde4884bd6412ac207ebea8" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters</caption><thead align="left"><tr id="dli_08_0105__en-us_topic_0114776188_en-us_topic_0103084433_r16c75fd8fdbf41c79f9aee82b032351c"><th align="left" class="cellrowborder" valign="top" width="14.26%" id="mcps1.3.4.2.2.3.1.1"><p id="dli_08_0105__en-us_topic_0114776188_en-us_topic_0103084433_a9dd69379a3f54904a9c510fb817659ad">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85.74000000000001%" id="mcps1.3.4.2.2.3.1.2"><p id="dli_08_0105__en-us_topic_0114776188_en-us_topic_0103084433_a7ede0d62539542baa7e367cf902bf2b2">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_08_0105__en-us_topic_0114776188_en-us_topic_0103084433_r8ab7399810eb42b7abf51ae705c6cf83"><td class="cellrowborder" valign="top" width="14.26%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0105__en-us_topic_0114776188_en-us_topic_0103084433_a1cdeda4790a8452d8619c797147bf9cf">db_name</p>
</td>
<td class="cellrowborder" valign="top" width="85.74000000000001%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0105__en-us_topic_0114776188_en-us_topic_0103084433_p4729195274115">Database name that contains letters, digits, and underscores (_). It cannot contain only digits or start with an underscore (_).</p>
</td>
</tr>
<tr id="dli_08_0105__en-us_topic_0114776188_en-us_topic_0103084433_r36540eab62c64ec4babb57549d5776e7"><td class="cellrowborder" valign="top" width="14.26%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0105__en-us_topic_0114776188_en-us_topic_0103084433_aa0912c807a254106a3a033e8ccb9e95e">table_name</p>
</td>
<td class="cellrowborder" valign="top" width="85.74000000000001%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0105__en-us_topic_0114776188_en-us_topic_0103084433_ae05b93123b5b41ff91b2875680e77dac">Table name of a database that contains letters, digits, and underscores (_). It cannot contain only digits or start with an underscore (_). The matching rule is <strong id="dli_08_0105__b757511773512">^(?!_)(?![0-9]+$)[A-Za-z0-9_$]*$</strong>. If special characters are required, use single quotation marks ('') to enclose them.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dli_08_0105__en-us_topic_0114776199_en-us_topic_0107972084_en-us_topic_0093946811_s9dc1b3ff840a4c59b5dc86e2fb41e0af"><h4 class="sectiontitle">Precautions</h4><p id="dli_08_0105__en-us_topic_0114776199_en-us_topic_0107972084_en-us_topic_0093946811_en-us_topic_0048831107_p41924151184">The to-be-queried table must exist. If this statement is used to query the information about a table that does not exist, an error is reported. </p>
</div>
<div class="section" id="dli_08_0105__en-us_topic_0114776199_en-us_topic_0107972084_en-us_topic_0093946811_sfaf2bdab19f94ff090be54b47e01d35d"><h4 class="sectiontitle">Example</h4><p id="dli_08_0105__en-us_topic_0114776199_en-us_topic_0107972084_en-us_topic_0093946811_aee721be1444441f78fe06ffe295caf6e">To query the names and data types of all columns in the <strong id="dli_08_0105__b17122515153211">student</strong> table, run the following statement:</p>
<div class="codecoloring" codetype="Sql" id="dli_08_0105__en-us_topic_0114776199_screen945834014113"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">DESCRIBE</span><span class="w"> </span><span class="n">student</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_0089.html">Viewing Tables</a></div>
</div>
</div>