Advertisement
Chajkii

xQuery

May 31st, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.24 KB | None | 0 0
  1. for $c in doc("Clients.xml")//CLIENT
  2. let $r:=doc("Rent.xml")//RENT
  3. for $noOfRents in count($r[@CLIENT_ID=$c/@ID])
  4. order by $noOfRents descending
  5. return
  6.     <client>
  7.         {$c/@ID, $c//NAME, $c//SURNAME}
  8.         <Rents>{$noOfRents}</Rents>
  9.     </client>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement