Puoi unirti alla tabella con una query aggregata che recuperi il call_time minimo par call_id di chiamate non terminate. Una chiamata non completata è una chiamata che non ha record in cui proceed_wait = 0 .
select t.queue_num_curr, t.ast_num_curr, count(*)
from mytable t
inner join (
select call_id, min(call_time) call_time
from mytable
group by call_id
having max(proceed_wait = 0) = 0
) tmin on tmin.call_id = t.call_id and tmin.call_time = t.call_time
group by t.queue_num_curr, t.ast_num_curr
order by t.queue_num_curr, t.ast_num_curr
queue_num_curr | ast_num_curr | count(*)
-------------: | -----------: | -------:
9004 | 2 | 1
9010 | 2 | 2
9010 | 3 | 1
9010 | 5 | 1
NB:penso che nei risultati, queue_num = 9004 dovrebbe avere ast_num = 2 invece di 1 (che dovrebbe corrispondere a call_id 49c43ad ).