I want to use the ascending or descending option dynamically based on xpath value.
let $order := "ascending"
for $aRslt in ("1","2","3","4")
order by ($aRslt)
if($order eq "ascending") then ascending else descending
return $aRslt
Using this throwing Error.
We can have the if condition for the whole "for" statement. But when we have more conditions in where; order by; and lot of statements in return, then it looks code duplicating just for the ascending or descending.
Is there any option to use without using condition for the whole "for".
empty greatest
). We use the same workaround as Tyler suggested. – dirkk