/****** Script for SelectTopNRows command from SSMS ******/ SELECT Count(*), OwnerID,FSL_TableCode,sku,LinkType,customerID,customerType,customerSku,mfrid,skuId FROM tbl_PRD_CustomerSkus where skuid IS NOT NULL GROUP BY OwnerID,FSL_TableCode,sku,LinkType,customerID,customerType,customerSku,mfrid,skuId HAVING Count(*) > 1