EasyManua.ls Logo

Mitsubishi Electric MELSEC iQ-R-R6SFM - Aggregate Function

Mitsubishi Electric MELSEC iQ-R-R6SFM
1028 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
1002
APPX
Appendix 14 List of Available SQL Commands for CPU Module Database Access Function
Aggregate Function
AVG
This command obtains a mean value.
Application example
To obtain the mean value of fld1 from table1 (including overlapped values)
SELECT AVG ("fld1") FROM "table1";
To obtain the mean value of fld1 from table1 (excluding overlapped values)
SELECT AVG (DISTINCT "fld1") FROM "table1";
COUNT
This command aggregates the number of records.
Application example
To obtain the number of records of fld1 from table1 (including overlapped values)
SELECT COUNT ("fld1") FROM "table1";
To obtain the number of records of fld1 from table1 (excluding overlapped values)
SELECT COUNT (DISTINCT "fld1") FROM "table1";
MAX
This command obtains a maximum value.
Application example
To obtain the maximum value of fld1 from table1
SELECT MAX ("fld1") FROM "table1";
MIN
This command obtains a minimum value.
Application example
To obtain the minimum value of fld1 from table1
SELECT MIN ("fld1") FROM "table1";
SUM
This command obtains the total.
Application example
To obtain the total of fld1 from table1 (including overlapped values)
SELECT SUM ("fld1") FROM "table1";
To obtain the total of fld1 from table1 (excluding overlapped values)
SELECT SUM (DISTINCT "fld1") FROM "table1";
Syntax
AVG ([numeric expression])
Syntax
COUNT [target]
Syntax
MAX ([numeric expression])
Syntax
MIN ([numeric expression])
Syntax
SUM ([numeric expression])

Table of Contents

Related product manuals