Something like this might get you thereselect case when row_number() over(partition by ProductID order by ProductID )= 1 then ProductID else null end, case when row_number() over(partition by ProductName order by ProductName ) =1 then ProductName else null end, CategoryName from(select 1 as ProductID, 'Green Flats' as ProductName, 'Shoes' as CategoryName union allselect 1 , 'Green Flats' , 'Access' union allselect 1 , 'Green Flats' , 'wa' union allselect 2 , 'Purple Belt' , 'Access' union allselect 2 , 'Purple Belt' , 'wa' ) sgroup by ProductID, ProductName, CategoryName
You might have to play around with the partition by to break it up a bit better