In our data schema Protocols can have one or more Components
in a CCM_PROTOCOL_COMPONENTS table with fields:
Have a query that groups the Components by COMPONENT_IDs ,
display how many times a Component is listed and
joins the Component_ID to the Component table to get the
Component_Name, copied herewith below.
Is there a way to group by Protocols and list the Components
that are associated with each Protocol?
Allen in Dallas
---Component Group By Query---
(SELECT COMPONENT_id, COUNT(*) as Num
FROM CCM.CCM_COMPONENT_PRICING CMP
group by COMPONENT_ID
join CCM_COMPONENT CMP on CMP.COMPONENT_ID = GBY.COMPONENT_ID
order by gby.Component_ID desc