Oops I left out the order by statement

 

  _____  

From: [email protected]
[mailto:[email protected]] On Behalf Of Tim Meagher
Sent: Wednesday, November 17, 2010 11:26 AM
To: 'General Mark Logic Developer Discussion'
Subject: Re: [MarkLogic Dev General] how to do query like group and max
insql

 

Hi Helen,

 

I guess the first thing I'd want to know is how big the resulting document
is going to be and hw you want to store it, i.e. do you want to fragment a
large document by coden or perhaps have a separate document for each unique
coden.

 

Secondly I would probably approach this as a transform, doing something like
this:

 

let $distinct-codens := distinct-values(~/article/coden/text())

return

  for $coden in $distinct-codens

        order by $coden

    return element coden {

      for $article in ~/article

        where $article/coden/text() eq $coden

        return (

          $article/volume,

          $article/issue,

          .

        )

}

 

Hope this helps!  I hope to see some more robust ideas come out.

 

Tim Meagher

 

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to