Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can use a QUERY or a table UPDATE to do arithmetic calculations. (Most people would just use a query, since usually there is no need to store the result in your table.)

For example: SELECT "FIELD_1"+"FIELD_2"+"FIELD_3" AS "TOTAL FROM "YOUR_TABLE"

If you wanted to store the total in a field for each new row added, you would need to use a table UPDATE in a TRIGGER (currently available in HSQLDB version 2.x but not the default version 1.8).

You can use a QUERY or a table UPDATE to do arithmetic calculations. (Most people would just use a query, since usually there is no need to store the result in your table.)

For example: SELECT "FIELD_1"+"FIELD_2"+"FIELD_3" AS "TOTAL "TOTAL" FROM "YOUR_TABLE"

If you wanted to store the total in a field for each new row added, you would need to use a table UPDATE in a TRIGGER (currently available in HSQLDB version 2.x but not the default version 1.8).

You can use a QUERY or a table UPDATE to do arithmetic calculations. (Most people would just use a query, since usually there is no need to store the result in your table.)

For example: SELECT "FIELD_1"+"FIELD_2"+"FIELD_3" AS "TOTAL" FROM "YOUR_TABLE"

If you wanted to store the total in a field for each new row added, you would need to use a table UPDATE in a TRIGGER (currently available in HSQLDB version 2.x but not the default version 1.8).

More info about SQL UPDATES & TRIGGERS....

HERE is some additional info about the SQL UPDATE syntax. If the UPDATE statement is executed by a TRIGGER - see HERE - the TABLE-COLUMN ROWS referenced by the UPDATE statement will be updated when the TRIGGER is executed. See HERE for more info about TRIGGERS using the HSQLDB engine. Note: SQL UPDATE statements can also be executed using the TOOLS>SQL... menu in Base. A TRIGGER will simply execute such an SQL statement when a NEW record is created (and so update a 'TOTAL' column in your TABLE when a NEW row/record is created.)

Warning: do not 'play around' with SQL UPDATE statements without having a BACKUP of your database, because if the UPDATE does NOT work as expected, there is NO 'undo'!

You can use a QUERY or a table UPDATE to do arithmetic calculations. (Most people would just use a query, since usually there is no need to store the result in your table.)

For example: SELECT "FIELD_1"+"FIELD_2"+"FIELD_3" AS "TOTAL" FROM "YOUR_TABLE"

If you wanted to store the total in a field for each new row added, you would need to use a table UPDATE in a TRIGGER (currently available in HSQLDB version 2.x but not the default version 1.8).

More info about SQL UPDATES & TRIGGERS....

HERE is some additional info about the SQL UPDATE syntax. If the UPDATE statement is executed by a TRIGGER - see HERE - the TABLE-COLUMN ROWS referenced by the UPDATE statement will be updated when the TRIGGER is executed. See HERE HERE for more info about TRIGGERS using the HSQLDB engine. Note: SQL UPDATE statements can also be executed using the TOOLS>SQL... menu in Base. A TRIGGER will simply execute such an SQL statement when a NEW record is created (and so update a 'TOTAL' column in your TABLE when a NEW row/record is created.)

Warning: do not 'play around' with SQL UPDATE statements without having a BACKUP of your database, because if the UPDATE does NOT work as expected, there is NO 'undo'!

You can use a QUERY or a table UPDATE to do arithmetic calculations. (Most people would just use a query, since usually there is no need to store the result in your table.)

For example: SELECT "FIELD_1"+"FIELD_2"+"FIELD_3" AS "TOTAL" FROM "YOUR_TABLE"

If you wanted to store the total in a field for each new row added, you would need to use a table UPDATE in a TRIGGER (currently available in HSQLDB version 2.x but not the default version 1.8).

More info about SQL UPDATES & TRIGGERS....

HERE is some additional info about the SQL UPDATE syntax. If the UPDATE statement is executed by a TRIGGER - see HERE - the TABLE-COLUMN ROWS referenced by the UPDATE statement will be updated when the TRIGGER is executed. See HERE for more info about TRIGGERS using the HSQLDB engine. Note: SQL UPDATE statements can also be executed using the TOOLS>SQL... menu in Base. A TRIGGER will simply execute such an SQL statement when a NEW record is created (and so update a 'TOTAL' column in your TABLE when a NEW row/record is created.)

Warning: Warning: do not 'play around' with SQL UPDATE statements without having a BACKUP of your database, because if the UPDATE does NOT work as expected, there is NO 'undo'!