Centrallix - It's Different than what you Think
Home   |   Technology   |   Screen Shots   |   Download   |   Documentation   |   History   |   For Developers

Search...


Search For:

Index...


Centrallix Documentation
1. Getting Started
2. Applications Overview
3. Application Components
4. Reports Overview
5. Report Components
6. SQL Language
7. Process Modeling
8. Application Modeling
9. Role-Based Security
10. Business Logic Modeling
11. Other Objects
12. External API's
13. Internal API's

6.8.2 Aggregate Functions


Aggregate Functions

Aggregate functions are used in queries, often in combination with a GROUP BY clause. These functions operate on multiple values from multiple records.

FunctionDescriptionStandard
avg(x)Computes the average of all values x. If no values were averaged, this returns NULL (since an average of no values is indefinite)ANSI
count(x)Returns the number of non-NULL values x. If no values were counted, this function returns 0. It does not count NULL values. To cause this function to count all rows in a SQL query, regardless of NULLs, then pass a constant value to count(), as in count(1). count(1) is the same as count(*) in other SQL languages.ANSI, except Centrallix requires count(1) instead of count(*).
first(x)Returns the first value x encountered. Note that in most cases, the order of values returned from a SQL query can not be guaranteed, so the meaningfulness of first() is highly dependent on the context of its use. This is sometimes useful along with ORDER BY to select the first value of x occurring in rows sorted by a different field.MS Access
last(x)Returns the last value x encountered. See discussion for first().MS Access
nth(x,n)Returns the nth value x encountered.MySQL/Oracle use nth_value()
max(x)Returns the highest value x encountered. If no values were found (or all were NULL), this function returns NULL.ANSI
min(x)Returns the smallest value x encountered.ANSI
sum(x)Returns the sum of all values x that were encountered. If no values were seen (or all were NULL), sum() returns NULL. This function, when x represents a string value, will return the concatenation of non-NULL values of x.ANSI, except on Strings. MySQL uses group_concat() for summing strings.



Comments...


(none yet)

Add a Comment...


Your Name:
Comment:


(c) 2001-2020 LightSys Technology Services, Inc. All trademarks are property of their respective owners.

Project Hosting Provided By:
Hosted by Sourceforge