OK, I think I understand now - the example data you gave is misleading because no SKUs are repeated across the tickets.Here's an example of how you can do what you want. I changed the SKUs so that it will actually give results that are meaningful. This is going to return all related SKUs, not just the top 10. You could work with this to get just related SKUs for one given SKU or top 10 etc.DECLARE @History TABLE (Ticket int, SKU varchar(30))INSERT @History (Ticket, SKU)SELECT 212624, '1' UNION ALLSELECT 212624, '2' UNION ALLSELECT 212624, '3' UNION ALLSELECT 212624, '4' UNION ALLSELECT 212628, '2' UNION ALLSELECT 212628, '3' UNION ALLSELECT 212628, '4' UNION ALLSELECT 212628, '5' UNION ALLSELECT 212628, '6' UNION ALLSELECT 212632, '1' UNION ALLSELECT 212632, '2' UNION ALLSELECT 212632, '3' UNION ALLSELECT 212634, '6' UNION ALLSELECT 212636, '1' UNION ALLSELECT 212636, '3' UNION ALLSELECT 212636, '4' UNION ALLSELECT 212636, '5' UNION ALLSELECT 212636, '6' UNION ALLSELECT 212639, '3' UNION ALLSELECT 212639, '4' UNION ALLSELECT 212639, '5' UNION ALLSELECT 212639, '6'SELECT Main.SKU, Other.SKU, count(*)FROM @History MainINNER JOIN @History Other ON Other.Ticket = Main.Ticket AND Other.SKU <> Main.SKUGROUP BY Main.SKU, Other.SKUORDER BY Main.SKU, count(*) DESC, Other.SKU