数据操作
GreatDB Cluster> insert into greatdb_cluster.t_range values(1,1),(50,50),(100,100), (200,200), (500,500), (1000,1000),(2000,2000);
Query OK, 7 rows affected (0.01 sec)
Records: 7 Duplicates: 0 Warnings: 0
GreatDB Cluster> insert into greatdb_cluster.t_hash values(1,1),(50,50),(100,100), (200,200), (500,500), (1000,1000),(2000,2000);
GreatDB Cluster> select * from t_range;
+------+------+
| c1 | c2 |
+------+------+
| 1 | 1 |
| 50 | 50 |
| 100 | 100 |
| 200 | 200 |
| 500 | 500 |
| 1000 | 1000 |
| 2000 | 2000 |
+------+------+
7 rows in set (0.00 sec)
GreatDB Cluster> delete from greatdb_cluster.t_range where c1 < 200;
Query OK, 3 rows affected (0.01 sec)
GreatDB Cluster> select * from greatdb_cluster.t_range;
+------+------+
| c1 | c2 |
+------+------+
| 200 | 200 |
| 500 | 500 |
| 1000 | 1000 |
| 2000 | 2000 |
+------+------+
4 rows in set (0.00 sec)
GreatDB Cluster> update greatdb_cluster.t_range set c2 = c2 +100;
Query OK, 4 rows affected (0.01 sec)
Rows matched: 4 Changed: 4 Warnings: 0
GreatDB Cluster> select * from greatdb_cluster.t_range;
+------+------+
| c1 | c2 |
+------+------+
| 200 | 300 |
| 500 | 600 |
| 1000 | 1100 |
| 2000 | 2100 |
+------+------+
4 rows in set (0.00 sec)
## cross-node join
GreatDB Cluster> select t1.c1, t2.c1, t1.c1+t2.c1 as sum from greatdb_cluster.t_range t1 join greatdb_cluster.t_hash t2 on t1.c1 + t2.c1 > 200 order by sum;
+------+------+------+
| c1 | c1 | sum |
+------+------+------+
| 200 | 1 | 201 |
| 1 | 200 | 201 |
.........
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




