asked on
select
MAX('M-'+parentstock.style) as Number,
case when charindex('(', parentstock.title) > 0 then rtrim(LEFT(parentstock.title, charindex('(',parentstock.title )-1)) else parentstock.title end as MasterStyle,
--CONCATENATE with coma sperators parentstock.title here
from parentstock
group by case when charindex('(', parentstock.title) > 0 then rtrim(LEFT(parentstock.title, charindex('(',parentstock.title )-1)) else parentstock.title end