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 Further information
date   TIMESTAMP() data type
decimal   DECIMAL() data type
set expr IDSET data type
STRINGSET data type
string   STRING data type
tuple expr Tuple literals are a collection of data types.

[unary_op] expr

expr binary_op expr

function_call

expr

CAST expr AS type_name

Syntax Example Result
CAST expr AS type_name SELECT CAST (25.65 AS int); 25

paren_select_stmt

expr

A SQL Statement nested within another SQL statement.

case_expr

expr