Count (query directive)
From WandoraWiki
(Difference between revisions)
(→Examples) |
|||
(One intermediate revision by one user not shown) | |||
Line 6: | Line 6: | ||
Count(Directive directive) | Count(Directive directive) | ||
+ | |||
+ | == Examples == | ||
+ | |||
+ | Following example counts all instances of the input directive. | ||
+ | |||
+ | importPackage(org.wandora.query2); | ||
+ | new Count(new Instances()) | ||
+ | |||
+ | Following example finds all topics in the topic map that have more than 5 instances. | ||
+ | |||
+ | importPackage(org.wandora.query2); | ||
+ | new Count(new Instances()) | ||
+ | .as("#count") | ||
+ | .from(new AllTopics().as("#topic")) | ||
+ | .where("#count",">","\"5\"",true) | ||
+ | |||
[[Category:Query directives]] | [[Category:Query directives]] |
Latest revision as of 13:04, 21 August 2009
[edit] Description
Counts the number of rows returned by the inner directive using same input the Count directive got.
[edit] Constructor
Count(Directive directive)
[edit] Examples
Following example counts all instances of the input directive.
importPackage(org.wandora.query2); new Count(new Instances())
Following example finds all topics in the topic map that have more than 5 instances.
importPackage(org.wandora.query2); new Count(new Instances()) .as("#count") .from(new AllTopics().as("#topic")) .where("#count",">","\"5\"",true)