Skip to main content Link Menu Expand (external link) Document Search Copy Copied

SQL Expressions

Table of contents

Before you begin

identifier

expr

FeatureBase identifiers (including object names such as databases, tables and columns) start with a lower-case alphabetic character and can include:

  • lower-case alphabetic characters
  • numbers 0-9
  • dash - and underscore _ characters.

expr

expr

Syntax Example Result
expr [NOT] LIKE expr SELECT * FROM products WHERE prodlist LIKE 'pen'; ballpen, pencil, playpen
expr IS [NOT] null SELECT * FROM services WHERE price IS null; free delivery on orders over $50
expr [NOT] between expr AND expr SELECT * from Products WHERE Price BETWEEN 10 AND 20; fountain pen, notepad, rubber ball
expr [NOT] IN ([SELECT_stmnt | expr,...]) Select * from Products where product_ID NOT IN (SELECT product_ID from Sales where product_name LIKE ear) gold-plated earplugs

Literals

Literals are explicitly specified fixed values that conform to a specific data type:

String literal BNF diagram Description Additional information
date     TIMESTAMP() data type
decimal     DECIMAL() data type
set expr   IDSET data type
STRINGSET data type
* IDSETQ data type
* STRINGSETQ
string     STRING data type
tuple expr Tuple literals are a collection of data types. TUPLE() function

[unary_op] expr

expr binary_op expr

function_call

expr

CAST <expr> AS <data-type>

Syntax Example Result Additional information
CAST <expr> AS <data-type> SELECT CAST (25.65 AS int); 25 CAST function

paren_select_stmt

expr

Description Additional information
A SQL Statement nested within another SQL statement SELECT Statement

case_expr

expr