UPS ya I was missing 20 and 30 ... didn't notice (Thks Remi : ) )
for the (10,a) pair I SAID the sol is not working... he needs to check the first name too...
Is his spec doesn't appear but I just wanted to point out that in that case is not working!
SELECT CASE WHEN cnt IS NULL THEN ltrim(str(A.IDRow))WHEN Cnt=1 THEN ltrim(str(A.IDRow)) ELSE '' END AS IDRow, A.FirstName, CASE WHEN B.IDRow IS NULL THEN '' ELSE A.Country END As Country
FROM #t A LEFT OUTER JOIN @MyTable1 B
ON A.IDRow=B.IDRow AND A.Country=B.Country