i have a resultset like this
Continent Country
------- -------
Asia Japan
Asia Russia
Asia India
Europe Britain
Europe France
from query
select continent,country from tablexxx
i want result in the format
Continent Country
------- -------
Asia Japan,Russia,India
Europe Britain,France
I have heard of pivot tables. but it seems difficult to me... any help with the query please :)
Here's my final solution in SQL Server , it works...:)
SELECT continents, Countries = replace
((SELECT Countries AS [data()]
FROM tblXXX
WHERE continents = a.continents
ORDER BY continents FOR xml path('')), ' ', ',' )
FROM tblXXXa
WHERE continents IS NOT NULL
GROUP BY continents