forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
41 lines
2.9 KiB
HTML
41 lines
2.9 KiB
HTML
<a name="mrs_01_0587"></a><a name="mrs_01_0587"></a>
|
|
|
|
<h1 class="topictitle1">Querying an OpenTSDB Table</h1>
|
|
<div id="body1589421621262"><p id="mrs_01_0587__p935785820529">This <strong id="mrs_01_0587__b563295119420">SELECT</strong> command is used to query data in an OpenTSDB table.</p>
|
|
<div class="section" id="mrs_01_0587__section6313185812529"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="mrs_01_0587__screen14702547347">SELECT * FROM table_name WHERE tagk=tagv LIMIT number;</pre>
|
|
</div>
|
|
<div class="section" id="mrs_01_0587__section1931315582526"><h4 class="sectiontitle">Keyword</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_0587__table1817193710524" frame="border" border="1" rules="all"><thead align="left"><tr id="mrs_01_0587__row42382375527"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.3.2.1.3.1.1"><p id="mrs_01_0587__p1423823745220"><strong id="mrs_01_0587__b22381637155219">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="70%" id="mcps1.3.3.2.1.3.1.2"><p id="mrs_01_0587__p18239537115218"><strong id="mrs_01_0587__b10239203715219">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_01_0587__row323913745210"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.3.2.1.3.1.1 "><p id="mrs_01_0587__p4512182532414">LIMIT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.3.2.1.3.1.2 "><p id="mrs_01_0587__p1523993745219">Used to limit the query results.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0587__row2239837105215"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.3.2.1.3.1.1 "><p id="mrs_01_0587__p96329379241">number</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.3.2.1.3.1.2 "><p id="mrs_01_0587__p7239103765217">Only the INT type is supported.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="mrs_01_0587__section1331415589523"><h4 class="sectiontitle">Precautions</h4><ul id="mrs_01_0587__ul855312117254"><li id="mrs_01_0587__li145541611142515">The to-be-queried table must exist. Otherwise, an error is reported.</li><li id="mrs_01_0587__li843852722514">The value of <strong id="mrs_01_0587__b2979111814515">tagv</strong> must exist. Otherwise, an error occurs.</li></ul>
|
|
</div>
|
|
<div class="section" id="mrs_01_0587__section1231515865218"><h4 class="sectiontitle">Example</h4><p id="mrs_01_0587__p53581058105212">Query data in the <strong id="mrs_01_0587__b178691241651">opentsdb_table</strong> table.</p>
|
|
<pre class="screen" id="mrs_01_0587__screen54985561847">SELECT * FROM opentsdb_table LIMIT 100;
|
|
SELECT * FROM opentsdb_table WHERE city='<span id="mrs_01_0587__ph82698492261">city1</span>';</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_0584.html">Interconnecting Spark with OpenTSDB</a></div>
|
|
</div>
|
|
</div>
|
|
|