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
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
表示