Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
The exact syntax is:
CALC [FROM table_list CALC] expressionThe part in square brackets can be omitted if no column is (directly) used in the expression. The examples will make clear what that means.
CALC 1+2is a simple expression not using a table. It shows how the CALC command can be used as a desk calculator.
CALC FROM mytable CALC mean(column1+column2)gives a vector of scalars containing the mean per row.
CALC sum([SELECT FROM mytable GIVING [mean(column1+column2)]])gives a single scalar giving the sum of the means in each row. Note that in this command the CALC command does not need the FROM clause, because it does not use a column itself. Columns are only used in the nested query which has a FROM clause itself.