Linked Questions

Popular Questions

I am using case statement to calculate statistics on certain criteria like following

avg(case when det.detection_time >0 then det.blocked_time end) 


sum(case when det.detection_time  =0 then 1 else 0 end) 

How should I apply case statement to get median..

Currently I am getting median like following:

PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER by det.blocked_time)

How should I add condition "case when det.detection_time >0" to the PERCENTILE_CONT block to get median for group where det.detection_time >0

Related Questions