1000
APPX
Appendix 14 List of Available SQL Commands for CPU Module Database Access Function
Clause
WHERE
This command conducts search with conditions.
■
Operators that can be used in [condition]
■
Application example
• To output a record with the fld1 value of 1 to 100 of table1
SELECT * FROM "table1" WHERE "fld1" BETWEEN 1 AND 100;
• To output fld1 and fld3 of the record with the fld3 value other than abc of table1
SELECT "fld1", "fld3" FROM "table1" WHERE NOT "fld3" = 'abc';
GROUP BY
This command groups elements.
■
Application example
• To group Table1 according to the value of fld1 and aggregate the number of records
SELECT COUNT(*) FROM "table1" GROUP BY "fld1";
HAVING
This command narrows down a search using the result of the aggregate function.
■
Application example
• To output only the groups whose total value is 50 or less
SELECT SUM ("fld2") FROM "table1" GROUP BY "fld1" HAVING SUM ("fld2") < 50;
Syntax
• To specify a condition
WHERE [condition]
• To specify an exception
WHERE NOT [condition];
• To specify two conditions with AND
WHERE [condition 1] AND [condition 2];
• To specify two conditions with OR
WHERE [condition 1] OR [condition 2];
Item
Description
Syntax
=
Equals
[numeric expression 1] = [numeric expression 2]
!=
Not equal to
[numeric expression 1] != [numeric expression 2]
<>
Not equal to
[numeric expression 1] <> [numeric expression 2]
>
Greater than
[numeric expression 1] > [numeric expression 2]
>=
Greater than or equal to
[numeric expression 1] >= [numeric expression 2]
<
Less than
[numeric expression 1] < [numeric expression 2]
<=
Less than or equal to
[numeric expression 1] <= [numeric expression 2]
IN
Brings the conditions to be set together.
IN ([numeric expression 1], [numeric expression 2],
, [numeric
expression 3])
BETWEEN
Specifies the range to be output.
[numeric expression 1] BETWEEN [numeric expression 2] AND
[numeric expression 3]
Syntax
GROUP BY [numeric expression]
Syntax
HAVING [numeric expression]
Содержание MELSEC iQ-R-R00CPU
Страница 2: ......
Страница 151: ...9 MONITOR FUNCTION 9 1 Real Time Monitor Function 149 9 MEMO ...
Страница 323: ...18 SEQUENCE SCAN SYNCHRONIZATION SAMPLING FUNCTION 321 18 MEMO ...
Страница 330: ...328 20 ROUTING SETTING 20 3 Precautions MEMO ...
Страница 423: ...26 BASIC CONCEPT 26 8 State Transition of the Redundant System 421 26 MEMO ...
Страница 524: ...522 30 MAINTENANCE AND INSPECTION FOR A REDUNDANT SYSTEM 30 1 Module Replacement in the Redundant System MEMO ...
Страница 1009: ...APPX Appendix 14 List of Available SQL Commands for CPU Module Database Access Function 1007 A MEMO ...
Страница 1014: ...1012 APPX Appendix 15 Added and Enhanced Functions MEMO ...
Страница 1027: ......