Hi,I have a requirements to evaluate or check if new model was added to an existing model per RequiredPart. My sample DDL was the result of my query created getting the model and requiredpart. My main query getting the requiredpart and finding or obtaining the model used in the requiredpart. Hoping my requirements is clear to understand. thank you in advance.Below sample data and DDLCreate table #Sample(Model nvarchar(35), RequiredPart nvarchar(35))Insert into #Sample(Model,RequiredPart )values ('2XRED','TTC1045'),('2XBLU','TTC1045'), ('2XBLK','TTC1045'),('2XRED','TTC1045'), ('8XBLU','BTC1045'),('8XRED','BTC1045'), ('8XRED','COR30044118XRED'),('2XRED','TTC1046'),('2XBLU','TTC1046'), ('8XRED','TTC1050'),('8XBLU','TTC1050')Select t.RequiredPart, Stuff((Select distinct ',' + model from #Sample where RequiredPart =t.RequiredPart for xml path ('')), 1 , 1 ,'') as ModelFrom #Sample tGroup by t.REQUIREDPARTOrder by t.REQUIREDPART Desired Result: need to add column CountRequiredPart-----Model-------------COUNTBTC1045----------8XBLU,8XRED--------2COR30044118XRED--8XRED--------------1TTC1045----------2XBLK,2XBLU,2XRED--3TTC1046----------2XBLU,2XRED--------2TTC1050----------8XBLU,8XRED--------2