Sorry :)
Is this better?
select
sum(case when depth = 0 then 1 else 0 end) Post_count,
sum(case when depth > 0 then 1 else 0 end) Comment_count,
sum(case when depth > 0 then len(body) else 0 end) Comment_Length,
sum(case when depth > 0 then 1 else 0 end)/sum(case when depth = 0 then 1 else 0 end) as Comments_Per_post,
sum(case when depth > 0 then len(body) else 0 end)/sum(case when depth > 0 then 1 else 0 end) as Comm_len_avg
from comments where author = 'arcange'
!ENGAGE 100
:(
Sent you some directly :)
If's way better! You can even use the new IIF() function to make it more readable:
select sum(IIF(depth = 0, 1,0) AS Postcount, sum(IIF(depth > 0, 1, 0)AS Commentcount, sum(IIF(depth > 0, len(body), 0) AS CommentLength, sum(IIF(depth > 0, 1, 0))/sum(IF(depth = 0, 1, 0)) AS CommentsPerpost, sum(IIF(depth > 0, len(body), 0))/sum(IIF(depth > 0, 1,0) AS Commlen_avg from comments where author = 'arcange' ```<div class="pull-right"><sub><a href="/steemreply/@arcange/introducing-steemreply-stay-in-touch-with-your-steem-network">Posted with <img src="http://steemreply.com/logo-comment.png"/></a></sub></div>