如何更新具有特定条件的表中值为null的列中的值 [英] How to update value in a Column which value is null in a table with specific condition

查看:98
本文介绍了如何更新具有特定条件的表中值为null的列中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的表名为T1

,值如下: -

I have table name T1
and values are as follows:-

Name
---
A
Null
Null
B
Null
Null



如何像这样更新


How to update like this

Name
-----
A
A
A
B
B
B

推荐答案

似乎没有真实情况。这些值没有按特定顺序显示,现在您只需将最后一个非空值分配给任何空值,直到下一个非空值。



顺便说一下,如果name是唯一没有任何其他列或索引的列,那么实际上不需要复制值。单个A和B就足够了。其他行没有任何意义,可以删除。



祝你好运!
There doesn't seem to be a real condition. The values are presented in no particular order and now you just assign the last non null value to any null value up until the next non null value.

By the way, if name is the only column without any other columns or index there really isn't any need to duplicate the values. A single A and B is enough. The other rows simply have no meaning and can be removed.

Good luck!


这篇关于如何更新具有特定条件的表中值为null的列中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆