[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Using Union Operator without Duplicate Records

Alice Wei ajwei at indiana.edu
Sat Dec 29 11:47:17 PST 2007


  Using Union Operator without Duplicate Records
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
http://x-query.com/mailman/listinfo/talk
812-856-2659



Purchase Stylus Studio Online Today!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.