470,636 Members | 1,381 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

Xml

Hello everybody

I have a table like this
1,red
1,black
1,red
2,red
2,yellow
2,green
2,red

with this Query
select num ,
xmlserialize(content xmlagg(
xmlelement(name "color", color))
as varchar(1024))
from table
group by num


I obtain
1 red, black, red
2 red, yellow, green, red

How can I obtain a unique list of colors, like this (of course without any stored procedure)
1 red, black
2 red, yellow, green,

thanks
Jan 4 '07 #1
0 1069

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by
1 post views Thread by Korara | last post: by
???
reply views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.