Created
April 2, 2015 16:08
-
-
Save joewiz/6d6e3972c44e3b85ef5b to your computer and use it in GitHub Desktop.
Travels of the Secretary of State, sorted by trip duration (longest to shortest), using XQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
for $trip in collection('/db/cms/apps/travels/data/secretaries')/trips/trip | |
let $duration := xs:date($trip/end-date) - xs:date($trip/start-date) | |
order by $duration descending | |
return <trip duration="{$duration}">{ $trip }</trip> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment