函数:
代码语言:javascript复制select
count (
1
) ,
COALESCE(NULLIF(trim(native_place),''),'其他') AS native_place
from
zhsq_user_info
where
is_delete = '0'
and
to_char (to_Date(create_time,'yyyy-MM-dd HH24:mi:ss'),'yyyy-MM-dd')
between to_char (to_Date(${startTime},'yyyy-MM-dd HH24:mi:ss'),'yyyy-MM-dd') and
to_char (to_Date(${endTime},'yyyy-MM-dd HH24:mi:ss'),'yyyy-MM-dd')
group by
COALESCE(NULLIF(trim(native_place),''),'其他')
COALESCE函数: 当列是空列,就转换为其他数值
NULLIF函数: 当列是空串,就转换为其他数值