I’m still rather new to MarkLogic and apparently have a lot to learn.  When 
doing research on a proof of concept, I ran across a situation that would be 
trivial to solve in SQL, but I’m having problems wrapping my head around how to 
do that in XQuery.  Or, is XQuery even the right place for this?

Basically, the number of notes per subject for any note that’s less than two 
years old.  If I was to do this in SQL, it’d look something like:

   select subject, count(*) from notes where date_taken > sysdate-(365*2) group 
by subject;

There’s some additional WHERE clause stuff for filtering, but on average, the 
number of results shouldn’t be large.

Any guidance on building up more complex queries like this?  The documentation 
is semi-helpful, but the examples it gives for usage are usually very 
simplistic.

Eric Ladner
Systems Analyst
[email protected]<mailto:[email protected]>


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

Reply via email to