简体   繁体   English

如何在 AWS Athena 中用 0 填充 null 值

[英]How to fill null values with 0 in AWS Athena

In Athena, what is the most efficient way to fill null values with 0?在 Athena 中,用 0 填充 null 个值的最有效方法是什么?

I think I can use Case statement, but I am also curious if there are other ways to do it.我想我可以使用Case语句,但我也很好奇是否有其他方法可以做到这一点。

We can use coalesce , here is Presto documentation on conditions which is what Athena is built on.我们可以使用coalesce是关于 Athena 构建条件的 Presto 文档。

select coalesce(myColumn, 0) from my_table_name

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

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