当前位置: 首页> 健康> 知识 > 三水网站制作公司_成人本科可以考公务员吗_windows优化大师可靠吗_seo招聘网

三水网站制作公司_成人本科可以考公务员吗_windows优化大师可靠吗_seo招聘网

时间:2025/7/11 19:40:39来源:https://blog.csdn.net/RodJohnsonDoctor/article/details/143508751 浏览次数:0次
三水网站制作公司_成人本科可以考公务员吗_windows优化大师可靠吗_seo招聘网

快速体验 TDengine

目标

  • 掌握tdengine写入与查询

步骤

步骤 1: 连接到 TDengine

首先,确保 TDengine 容器正在运行。您可以使用以下命令连接到 TDengine 的命令行工具:

[root@master105 docker-tdengine]# docker exec -it  1e2331476ee2 taos
Welcome to the TDengine Command Line Interface, Client Version:3.3.2.0
Copyright (c) 2023 by TDengine, all rights reserved.*********************************  Tab Completion  **************************************   The TDengine CLI supports tab completion for a variety of items,                   **   including database names, table names, function names and keywords.                **   The full list of shortcut keys is as follows:                                      **    [ TAB ]        ......  complete the current word                                  **                   ......  if used on a blank line, display all supported commands    **    [ Ctrl + A ]   ......  move cursor to the st[A]rt of the line                     **    [ Ctrl + E ]   ......  move cursor to the [E]nd of the line                       **    [ Ctrl + W ]   ......  move cursor to the middle of the line                      **    [ Ctrl + L ]   ......  clear the entire screen                                    **    [ Ctrl + K ]   ......  clear the screen after the cursor                          **    [ Ctrl + U ]   ......  clear the screen before the cursor                         *****************************************************************************************Server is TDengine Community Edition, ver:3.3.2.0 and will never expire.taos>
步骤 2: 创建数据库和表

在 TDengine 的命令行工具中,执行以下 SQL 语句来创建数据库和表:

taos> CREATE DATABASE weather;
Create OK, 0 row(s) affected (0.477529s)taos> USE weather;
Database changed.taos>
taos> CREATE TABLE temperature (>     ts TIMESTAMP,>     location BINARY(20),>     temperature FLOAT> );
Create OK, 0 row(s) affected (0.004864s)
步骤 3: 插入数据

插入一些示例数据:


taos> INSERT INTO temperature VALUES ('2023-10-01 00:00:00', 'Beijing', 25.0);
Insert OK, 1 row(s) affected (0.001290s)taos> INSERT INTO temperature VALUES ('2023-10-01 01:00:00', 'Shanghai', 27.5);
Insert OK, 1 row(s) affected (0.000572s)taos> INSERT INTO temperature VALUES ('2023-10-01 02:00:00', 'Guangzhou', 30.0);
Insert OK, 1 row(s) affected (0.000722s)taos> INSERT INTO temperature VALUES ('2023-10-01 03:00:00', 'Beijing', 24.5);
Insert OK, 1 row(s) affected (0.002174s)
步骤 4: 查询数据

查询刚刚插入的数据:

taos> SELECT * FROM temperature;ts            |        location        |     temperature      |
==========================================================================2023-10-01 00:00:00.000 | Beijing                |           25.0000000 |2023-10-01 01:00:00.000 | Shanghai               |           27.5000000 |2023-10-01 02:00:00.000 | Guangzhou              |           30.0000000 |2023-10-01 03:00:00.000 | Beijing                |           24.5000000 |
Query OK, 4 row(s) in set (0.005201s)

感谢阅读!如果你喜欢这篇文章,不妨分享给你的朋友。想要获取更多技术资讯,可以关注我们的微信号:aldrichsea。我们在那里等你,一起探索技术的无限可能。

关键字:三水网站制作公司_成人本科可以考公务员吗_windows优化大师可靠吗_seo招聘网

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: