XML: Return elements of a sequence that occur certain number of times

后端 未结 2 419
傲寒
傲寒 2021-01-28 08:23

I have an XML file with information on movies. I want my expression to return the directors in the XML that have directed more than 1 movie.

What I have now is:

2条回答
  •  北海茫月
    2021-01-28 08:52

    Try this:

    for $director in distinct-values(//director)
    where count(//video[director = $director]) > 1
    return $director
    

提交回复
热议问题