SonicBase. In-memory embedded or distributed streaming sql database

SQL Select With Math Statement


Syntax

SELECT select_columns FROM table_name [WHERE expression]
select_columns:   * for all columns or comma separated list of column names
table_name:  name of table to select records from
expression:   column | constant | parameter | not expression | (expression) |
expression operator expression | in (expression [, expression...])
operator:   or | and | = | != | < | > | <= | >= | + | - | * | / | & | | | ^ | %
+   plus
-   minus
*   multiply
/   divide
&   bitwise and
|   bitwise or
^   bitwise xor
%   modulo

Examples


PreparedStatement stmt = conn.prepareStatement("select * from persons where id > 1 and id = id2 + 100 limit 3");
ResultSet ret = stmt.executeQuery();
        
PreparedStatement stmt = conn.prepareStatement("select * from persons where id = id2 % 100"); ResultSet ret = stmt.executeQuery();