首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >Mycat 运行与基础操作6

Mycat 运行与基础操作6

作者头像
franket
发布于 2021-12-03 20:20:19
发布于 2021-12-03 20:20:19
3550
举报
文章被收录于专栏:技术杂记技术杂记

删除数据

代码语言:javascript
复制
mysql> select *  from catworld4 where id=9;
+----+------+
| id | name |
+----+------+
|  9 | abc  |
+----+------+
1 row in set (0.00 sec)

mysql> delete from catworld4 where id=9;
Query OK, 1 row affected (0.05 sec)

mysql> select *  from catworld4 where id=9;
Empty set (0.00 sec)

mysql> 

查询数据

代码语言:javascript
复制
mysql> select *  from catworld4 ;
+----+------+
| id | name |
+----+------+
|  4 | abc  |
|  8 | abc  |
|  1 | abc  |
|  3 | abc  |
|  7 | abc  |
|  5 | abc  |
|  2 | abc  |
|  6 | abc  |
| 10 | abc  |
+----+------+
9 rows in set (0.01 sec)

mysql> select count(*) from catworld4;
+--------+
| COUNT0 |
+--------+
|      9 |
+--------+
1 row in set (0.01 sec)

mysql> select *  from catworld4 order by id;
+----+------+
| id | name |
+----+------+
|  1 | abc  |
|  2 | abc  |
|  3 | abc  |
|  4 | abc  |
|  5 | abc  |
|  6 | abc  |
|  7 | abc  |
|  8 | abc  |
| 10 | abc  |
+----+------+
9 rows in set (0.08 sec)

mysql> select distinct(name) from catworld4;
+------+
| name |
+------+
| abc  |
+------+
1 row in set (0.09 sec)

mysql> insert into catworld4(name,id) values("def",9);
Query OK, 1 row affected (0.02 sec)

mysql> select distinct(name) from catworld4;
+------+
| name |
+------+
| abc  |
| def  |
+------+
2 rows in set (0.01 sec)

mysql> 

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

目录
  • 删除数据
  • 查询数据
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档