【发布时间】:2020-06-06 01:13:45
【问题描述】:
给定一个表,其中包含几列(数字和索引很重要)和几行。
|number|index|line|
| 1234 | blue| 0 |
| 1234 | blue| 1 |
| 567 | blue| 0 |
我正在尝试将 index = blue 的行更新为 index = red,但列“number”和“index”不允许相同。我尝试将列分组在一起,如果列号 = 数字和索引 = 索引则返回错误语句
我怎样才能做到这一点?
预期结果:
|number|index|line|
|1234 |blue |0 |
|1234 |blue |1 |
|567 |red |0 |
【问题讨论】: