Code Listing 2: Book price query, reordered by price

<books-with-prices>
 {
  for $b in document("http://www.bn.com/bib.xml")//book,
    $a in document("http://www.amazon.com/reviews.xml")//entry

  where $b/title = $a/title
  order by min(($a|$b)/price) {-- new addition --}
  return
   <book-with-prices>
    { $b/title }
    <price-amazon>{ $a/price/text() }</price-amazon>

    <price-bn>{ $b/price/text() }</price-bn>
   </book-with-prices>
 }
</books-with-prices>


Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy