Hi there!
I have the following SELECT Statment:
SELECT IDLivro,Titulo
,LEFT(Nome, LEN(Nome) - 2) AS Nome
,LEFT(Categoria, LEN(Categoria) - 2) AS Categoria
,Posicao
,Classificacao
,Comentario
FROM
(
SELECT L.Titulo
,(
SELECT A.Nome + ' ; ' AS "text()"
FROM dbo.Autor A
JOIN dbo.LivroAutor LA
ON A.IDAutor = LA.IDAutor
WHERE LA.IDLivro = L.IDLivro
ORDER BY A.Nome DESC
FOR XML PATH('')
) AS Nome
,(
SELECT C.Categoria + ' ; ' AS "text()"
FROM dbo.Categoria C
JOIN dbo.LivroCategoria LC
ON C.IDCategoria = LC.IDCategoria
WHERE LC.IDLivro = L.IDLivro
ORDER BY C.Categoria DESC
FOR XML PATH('')
) AS Categoria
,L.Posicao
,L.Classificacao
,L.IDLivro
,L.Comentario
FROM dbo.Livro L
) D
That gives me that:
[img]http://img18.imageshack.us/img18/3556/antesu.jpg[/img]
and i need that:
[img]http://img33.imageshack.us/img33/7030/depoisi.jpg[/img]
(Edited in PAINT lol)
My structure is:
[img]http://img33.imageshack.us/img33/9710/structureu.jpg[/img]
Can you help me please?
Thanks