繁体   English   中英

如何从每列中删除空值

[英]How will I remove nulls from each columns

我将如何从每列中删除空值这是示例

Column 1  Column 2 column 3  column 4 
a           1        null      null   
b           0        null      null   
c           1        null      null   
a           null      0        null   
b           null      1        null   
c           null      0        null   
a           null     null       1     
b           null     null       1     
c           null     null       0     

我希望它看起来像这样

Column 1  Column 2 column 3  column 4  
a            1        0         1      
b            0        1         1      
c            1        0         0      

这可能吗? 您可能会看到图像前后的附件图片。

您可以使用聚合:

select col1, max(col2) as col2, max(col3) as col3, max(col4) as col4
from t
group by col1;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM