odps - SQL语句问题?
本文介绍了odps - SQL语句问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
select sum(case child_id when '' then 0 else 1 end) growth_photo_count,
-1 as fc from t_growth_photo tgp
这个SQL如何理解?? 尤其是 sum(case child_id when '' then 0 else 1 end) growth_photo_count
解决方案
如同if else
child_id为空按0统计,否则按1统计 ,统计的字段用growth_photo_count
表示
这篇关于odps - SQL语句问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文