Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 如何从每列中删除空值_Sql_Database_Oracle_Plsql - Fatal编程技术网

Sql 如何从每列中删除空值

Sql 如何从每列中删除空值,sql,database,oracle,plsql,Sql,Database,Oracle,Plsql,如何从每列中删除空值 这就是一个例子 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

如何从每列中删除空值 这就是一个例子

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;

您可以使用聚合:

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

那么在同一行的一列中有两个相同值的可能性呢?首先是什么创建了这些“输入”?这是其他早期计算的结果吗?如果是这样的话,那么如果你解释整个问题(而不仅仅是其中的一部分),我们也许能够帮助你解决整个问题,这比生成这个中间结果然后进一步处理要简单得多。那么在一列中为两行相同的值的可能性呢?是什么产生了这些“输入”首先?这是其他早期计算的结果吗?如果是这样的话,那么如果你解释整个问题(而不仅仅是其中的一部分),我们可以帮助你解决整个问题,这比生成这个中间结果然后进一步处理它要简单得多。