presto sql中相当于 nvl的函数

nvl 是hive sparksql中常用的函数,其主要用法如下

例如NVL(string1,replace_with)中:
当第一个参数(string1)为null时,返回第二个参数(replace_with);
当第一个参数(string1)不为null时,则返回第一个参数(string1

presto中没有nvl函数,可以使用coalesce函数替代

coalesce (my_field_1,my_field_2,my_field_3,my_field_4,my_field_5)  
posted @ 2022-05-07 11:00  羽毛球打的贼好  阅读(5146)  评论(0)    收藏  举报