[xquery-talk] Using Union Operator without Duplicate Records
Alice Wei
ajwei at indiana.edu
Sat Dec 29 11:47:17 PST 2007
Hi,
I am not sure if any one of you have tried using the union operator
to concatenate all the results without duplicates.
This is what I have now:
{
for $file in doc("resume_2.xml")//author
let $author := distinct-values($file[./@type='co-author' ] union
$file[./@type='Faculty'])
order by $author ascending
return <li>{data($author)}</li>
}
It appears that even though I do have distinct-values here, it is not
working as I have thought, and I tried using
let $author := distinct-values($file[./@type='co-author' ] union
$file[./@type='Faculty'][1])
to bring back only the first value, but it is not working either.
Anyone of you can help?
Note: It appears that I can use union all to do this in SQL, but it
does not seem to be supported in XQuery, is it?
Thanks to those who can help.
Alice Wei
MIS 2008
School of Library and Information Science
Indiana University Bloomington
ajwei at indiana.edu
812-856-2659
More information about the talk
mailing list