Sum (query directive)

From WandoraWiki
(Difference between revisions)
Jump to: navigation, search
 
 
Line 11: Line 11:
 
Following example sums the number of instances of each instances.  
 
Following example sums the number of instances of each instances.  
  
importPackage(org.wandora.query2);
+
importPackage(org.wandora.query2);
new Sum(
+
new Sum(
  new Count(new Instances())
+
  new Count(new Instances())
  .from(new Instances())
+
  .from(new Instances())
)
+
)
  
 
Note that you can do the same thing easier without the ''Sum''.
 
Note that you can do the same thing easier without the ''Sum''.
  
importPackage(org.wandora.query2);
+
importPackage(org.wandora.query2);
new Count(new Instances().from(new Instances()))
+
new Count(new Instances().from(new Instances()))
  
  
 
[[Category:Query directive]]
 
[[Category:Query directive]]

Latest revision as of 13:11, 25 August 2009

[edit] Description

Returns the sum of values of active column.

[edit] Constructor

Sum(Directive directive)

[edit] Examples

Following example sums the number of instances of each instances.

importPackage(org.wandora.query2);
new Sum(
  new Count(new Instances())
  .from(new Instances())
)

Note that you can do the same thing easier without the Sum.

importPackage(org.wandora.query2);
new Count(new Instances().from(new Instances()))
Personal tools