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

return only latest version of an item

A. Steven Anderson steve at asanderson.com
Thu May 14 15:18:40 PDT 2009


  return only latest version of an item
Greetings!

I've got a pretty complex xquery that returns only the latest version of all
items in a collection, but I know there has got to be a more efficient way
to do it.

A simplified example of the XML that I'm dealing with (i.e. not invented
here) is as follows:

<items>
   <item>
      <id>1</id>
      <name>item # 1</name>
      <version>1</version>
   </item>
   <item>
      <id>1</id>
      <name>item # 1</name>
      <version>2</version>
   </item>
   <item>
      <id>1</id>
      <name>item # 1</name>
      <version>3</version>
   </item>
   <item>
      <id>2</id>
      <name>item # 2</name>
      <version>1</version>
   </item>
   <item>
      <id>2</id>
      <name>item # 2</name>
      <version>2</version>
   </item>
   <item>
      <id>3</id>
      <name>item # 3</name>
      <version>1</version>
   </item>
</items>

What would be the most efficient way to do this?

Thanks in advance!

-- 
A. Steven Anderson
Independent Consultant
http://x-query.com/mailman/listinfo/talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20090514/caac92c0/attachment.htm


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.