602SQL Documentation Index  

Expressions (SQL)

expression ::= simple_expression { operator simple_expression }
simple_expression ::= literal            |
                    column_name          |
                    constants            |
                    subquery             |
                    CASE_expression      |
                    function_call        |
                    sequence_reference   |
                    server_variable      |
                    system_variable      |
                    client_variable      |
operator ::=  + | - | * | / | MOD | DIV | chaining

A expression is a syntactically correct notation that can be evaluated. Details about the simple expression elements can be found on the following pages:

  Literals Column name
  CASE expression Subqueries
  SQL functions Sequences
  Client variables Server variable
  Server system variables  

Details about operators and operator usage for different types can be found on these pages:

  Arithmetic expressions String expressions Expressions with date and time

Dynamic parameters (i.e. question mark, e.g ... WHERE id=? ...) are used only when accessing the server through ODBC, JDBC or other appropriate API (e.g. Prepared SQL functions in PHP).

Logical expressions (expressions that can be either TRUE, FALSE, UNKNOWN), called conditions, are described in this chapter.

List of topics: