I am trying to count all rows that meet a criteria, and then also have it list sequence numbers for each row so we can quickly identify those meeting the criteria. Ex: We know 5 meet criteria of Complete Response and we want to know there are 5 but also what those sequence numbers are. How would i write that in my query?
select
count(sf.protocol_subject_id) as responseCount, sf.BEST_RESPONSE
from oncore.sv_sub_followup sf
where sf.protocol_no = $P{pPclNo} and sf.best_response is not null
group by sf.best_response
order by decode(best_response, 'Complete Response', 1, 'Partial Response', 2, 'Stable', 3, 'Progressive', 4, 'Not Evaluable', 5)
I should also mentioned that this is one of 9 subreports compiling a larger report. Not sure if that makes a difference when trying to do this. I'm very new to pl/sql. Thanks in advance for any help.