This project is read-only.

Aggregate Canonical Functions

Avg( expression )

Description
Returns the average of the non-null values.

Examples

select value avg(p.UnitPrice) from Products as p

BigCount ()

Description
Returns the size of the aggregate including null and duplicate values.

Examples

select value bigcount() from products as p

Count ()

Description
Returns the size of the aggregate including null and duplicate values.

Examples

select value count() from products as p
select value count(c.Products) from category as c
select c.CategoryId, count(select p from c.Products as p) as ProductsCount from category as c

Max (expression)

Description
Returns the maximum of the non-null values.

Examples

select value max(p.UnitPrice) from Products as p
select max(select value p.UnitPrice from c.Products as p) from Categories as c

Min (expression)

Description
Returns the minimum of the non-null values.

Examples

select value min(p.UnitPrice) from Products as p
select min(select value p.UnitPrice from c.Products as p) from Categories as c

Sum (expression)

Description
Returns the sum of the non-null values.

Examples

select sum(o.UnitPrice) from OrderDetails as o
select key, sum(o.Quantity) as SumQuantity  from OrderDetails as o group by o.Product as key

Last edited Mar 24, 2013 at 9:21 AM by ansiboy, version 1

Comments

No comments yet.