Create TABLE #x( ShopkeeperID INT, DealerID INT, amtlimit int);
INSERT #X(ShopkeeperID, DealerID, amtlimit) VALUES
(1,1,20), (1,1,30), (2,1,20), (2,2,20),
(2,2,20), (3,1,20), (3,1,20), (3,2,60),
(3,2,60);
############################################
SELECT COUNT(t.ShopkeeperID) as tcount, t.ShopkeeperID, t.DealerID
,STUFF((SELECT ', ' + CAST(t1.amtlimit AS VARCHAR(10)) [text()]
FROM #x t1
WHERE t1.DealerID = t.DealerID and t1.ShopkeeperID = 3
FOR XML PATH(''), TYPE)
.value('.','NVARCHAR(MAX)'),1,2,' ') List_Output
FROM #x t
where t.ShopkeeperID = 3
GROUP BY t.ShopkeeperID, t.DealerID