功能说明
UPDATE 时,不能更新自增列。
示例
create table t2(a int auto_increment primary key,b varchar(100), c int)
distributed by ('b');
GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
1034
insert into t2(b,c) values('a1',1),('a2',2),('a3',3),('a4',4),('a5',5);
gbase> SELECT * FROM t2;
+---+------+------+
| a | b
| c
|
+---+------+------+
| 3 | a2
|
2 |
| 1 | a3
|
3 |
| 2 | a1
|
1 |
| 6 | a5
|
5 |
| 4 | a4
|
4 |
+---+------+------+
5 rows in set (Elapsed: 00:00:00.02)
gbase> update t2 set c = 144 where b = 'a2';
Query OK, 1 row affected (Elapsed: 00:00:00.08)
Rows matched: 1
Changed: 1
Warnings: 0
gbase> update t2 set a = 441 where b = 'a2';
ERROR 1235 (42000): This version of GBase doesn't yet support 'update/merge on
auto_increment column'
gbase> SELECT * from t2;
+---+------+------+
| a | b
| c
|
+---+------+------+
| 1 | a3
|
3 |
| 3 | a2
|
144 |
GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
1035
| 2 | a1
|
1 |
| 6 | a5
|
5 |
| 4 | a4
|
4 |
+---+------+------+
5 rows in set (Elapsed: 00:00:00.02)