mysql> update test.students set fs=100 where sid=3;
ERROR 1105 (HY000): errCode = 2, detailMessage = Only unique table could be updated.
复制代码
可以看到更新数据失败,提示只有主键模型支持更新数据。
5.删除数据
doris删除数据时,如果没有指定分区,需要设置会话参数
set delete_without_partition = true;
mysql> select * from students;
+------+------------+----------+--------+------+
| sid | sname | saddress | sxk | fs |
+------+------------+----------+--------+------+
| 2 | lisi | 成都 | 语文 | 98.5 |
| 1 | zhangsan | 重庆 | 语文 | 98.5 |
| 1 | zhangsan | 重庆 | 语文 | 98.5 |
| 4 | zhangliang | 北京 | 数学 | 98.5 |
| 3 | wangwu | 北京 | 语文 | 98.5 |
+------+------------+----------+--------+------+
5 rows in set (0.13 sec)
mysql> delete from students where sid=4;
ERROR 1105 (HY000): errCode = 2, detailMessage = errCode = 2, detailMessage = This is a range or list partitioned table. You should specify partition in delete stmt, or set delete_without_partition to true