Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11 | 3.10

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

SQL building

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

SQL is a declarative language that is hard to integrate into procedural, object-oriented, functional or any other type of programming languages. jOOQ's philosophy is to give SQL the credit it deserves and integrate SQL itself as an "internal domain specific language" directly into Java.

With this philosophy in mind, SQL building is the main feature of jOOQ. All other features (such as SQL execution and code generation) are mere convenience built on top of jOOQ's SQL building capabilities.

This section explains all about the various syntax elements involved with jOOQ's SQL building capabilities. For a complete overview of all syntax elements, please refer to the manual's sections about SQL to DSL mapping rules.

Table of contents

3.1.
The query DSL type
3.1.1.
DSL subclasses
3.2.
The DSLContext API
3.2.1.
SQL Dialect
3.2.2.
SQL Dialect Family
3.2.3.
SQL Dialect Category
3.2.4.
Connection vs. DataSource
3.2.5.
Custom data
3.2.6.
Custom ExecuteListeners
3.2.7.
Custom Unwrappers
3.2.8.
Custom Settings
3.2.8.1.
Auto-attach Records
3.2.8.2.
Auto-inline bind values
3.2.8.3.
Backslash Escaping
3.2.8.4.
Batch size
3.2.8.5.
Computed column activation (new)
3.2.8.6.
Computed column emulation
3.2.8.7.
Diagnostics Connection
3.2.8.8.
Diagnostics Logging
3.2.8.9.
Dialect compatibility
3.2.8.10.
Dirty tracking (new)
3.2.8.11.
Dollar quoted string token
3.2.8.12.
Execute Logging
3.2.8.13.
Execute Logging SQL Exceptions
3.2.8.14.
Fetching trimmed CHAR types (new)
3.2.8.15.
Fetch Warnings
3.2.8.16.
GROUP_CONCAT Configuration
3.2.8.17.
Identifier style
3.2.8.18.
Implicit join type
3.2.8.19.
Inline Threshold
3.2.8.20.
IN-list Padding
3.2.8.21.
Interpreter Configuration
3.2.8.22.
JDBC Flags
3.2.8.23.
Keyword style
3.2.8.24.
Listener Invocation Order
3.2.8.25.
Locales
3.2.8.26.
Map JPA Annotations
3.2.8.27.
Object qualification
3.2.8.28.
Object qualification for columns
3.2.8.29.
Optimistic Locking
3.2.8.30.
Parameter name prefix
3.2.8.31.
Parameter types
3.2.8.32.
Parser Configuration
3.2.8.33.
Readonly column behaviour
3.2.8.34.
Reflection caching
3.2.8.35.
Return all columns on store
3.2.8.36.
Return computed columns on store
3.2.8.37.
Return DEFAULT columns on store
3.2.8.38.
Return Identity Value On Store
3.2.8.39.
Runtime catalog, schema and table mapping
3.2.8.40.
Scalar subqueries for stored functions
3.2.8.41.
SEEK clause implementation
3.2.8.42.
Statement Type
3.2.8.43.
Updatable Primary Keys
3.2.9.
Thread safety
3.3.
The DSL API
3.3.1.
Mutability (historic)
3.4.
The model API
3.4.1.
Design
3.4.2.
Traversal
3.4.3.
Replacement
3.4.3.1.
Pattern transformation Replacer
3.4.3.2.
Table mapping Replacer
3.4.3.3.
Listening Replacer
3.4.3.4.
Decomposing Replacer
3.4.4.
The historic model API
3.5.
SQL Statements (DML)
3.5.1.
The WITH clause
3.5.2.
The WITH RECURSIVE clause
3.5.3.
The SELECT statement
3.5.3.1.
SELECT clause
3.5.3.1.1.
Projection type safety
3.5.3.1.2.
SelectField
3.5.3.1.3.
Tables as SelectField
3.5.3.1.4.
SELECT *
3.5.3.1.5.
SELECT * EXCEPT (...)
3.5.3.1.6.
SELECT DISTINCT
3.5.3.1.7.
SELECT DISTINCT ON
3.5.3.1.8.
Convenience methods
3.5.3.2.
FROM clause
3.5.3.3.
JOIN operator
3.5.3.4.
Implicit path JOIN
3.5.3.5.
Implicit to-many path JOIN
3.5.3.6.
Explicit path JOIN
3.5.3.7.
Implicit path correlation
3.5.3.8.
WHERE clause
3.5.3.9.
CONNECT BY clause
3.5.3.10.
GROUP BY clause
3.5.3.10.1.
GROUP BY columns
3.5.3.10.2.
GROUP BY column index
3.5.3.10.3.
GROUP BY tables
3.5.3.10.4.
GROUP BY ROLLUP
3.5.3.10.5.
GROUP BY CUBE
3.5.3.10.6.
GROUP BY GROUPING SETS
3.5.3.10.7.
GROUP BY empty grouping set
3.5.3.11.
HAVING clause
3.5.3.12.
WINDOW clauseWINDOW clause
3.5.3.13.
QUALIFY clause
3.5.3.14.
ORDER BY clause
3.5.3.14.1.
Ordering by field index
3.5.3.14.2.
Ordering and NULLS
3.5.3.14.3.
Ordering using CASE expressions
3.5.3.14.4.
Oracle's ORDER SIBLINGS BY clause
3.5.3.15.
LIMIT .. OFFSET clause
3.5.3.16.
WITH TIES clause
3.5.3.17.
SEEK clause
3.5.3.18.
FOR clause
3.5.3.19.
FOR UPDATE clause
3.5.3.20.
Set operations
3.5.3.20.1.
Type safety
3.5.3.20.2.
Projection rowtype
3.5.3.20.3.
Differences to standard SQL
3.5.3.20.4.
UNION
3.5.3.20.5.
INTERSECT
3.5.3.20.6.
EXCEPT
3.5.3.21.
Lexical and logical SELECT clause order
3.5.4.
The INSERT statement
3.5.4.1.
INSERT .. VALUES
3.5.4.2.
INSERT .. DEFAULT VALUES
3.5.4.3.
INSERT .. SET
3.5.4.4.
INSERT .. SELECT
3.5.4.5.
INSERT .. ON DUPLICATE KEY UPDATE
3.5.4.6.
INSERT .. ON DUPLICATE KEY UPDATE .. EXCLUDED
3.5.4.7.
INSERT .. ON DUPLICATE KEY UPDATE .. SET ALL TO EXCLUDED
3.5.4.8.
INSERT .. ON DUPLICATE KEY IGNORE
3.5.4.9.
INSERT .. ON CONFLICT
3.5.4.10.
INSERT .. ON CONFLICT .. EXCLUDED
3.5.4.11.
INSERT .. ON CONFLICT .. SET ALL TO EXCLUDED
3.5.4.12.
INSERT .. RETURNING
3.5.5.
The UPDATE statement
3.5.5.1.
UPDATE .. SET
3.5.5.2.
UPDATE .. SET ROW
3.5.5.3.
UPDATE .. FROM
3.5.5.4.
UPDATE .. WHERE
3.5.5.5.
UPDATE .. ORDER BY .. LIMIT
3.5.5.6.
UPDATE .. RETURNING
3.5.6.
The DELETE statement
3.5.6.1.
DELETE .. USING
3.5.6.2.
DELETE .. WHERE
3.5.6.3.
DELETE .. ORDER BY .. LIMIT
3.5.6.4.
UPDATE .. RETURNING
3.5.7.
The MERGE statement
3.6.
SQL Statements (DDL)
3.6.1.
The ALTER statement
3.6.1.1.
ALTER DATABASE
3.6.1.1.1.
ALTER DATABASE .. RENAME
3.6.1.1.2.
ALTER DATABASE IF EXISTS
3.6.1.2.
ALTER DOMAIN
3.6.1.2.1.
ALTER DOMAIN .. RENAME
3.6.1.2.2.
ALTER DOMAIN .. SET DEFAULT
3.6.1.2.3.
ALTER DOMAIN .. DROP DEFAULT
3.6.1.2.4.
ALTER DOMAIN .. SET NOT NULL
3.6.1.2.5.
ALTER DOMAIN .. DROP NOT NULL
3.6.1.2.6.
ALTER DOMAIN .. ADD CONSTRAINT
3.6.1.2.7.
ALTER DOMAIN .. RENAME CONSTRAINT
3.6.1.2.8.
ALTER DOMAIN .. RENAME CONSTRAINT IF EXISTS
3.6.1.2.9.
ALTER DOMAIN .. DROP CONSTRAINT
3.6.1.2.10.
ALTER DOMAIN .. DROP CONSTRAINT IF EXISTS
3.6.1.2.11.
ALTER DOMAIN IF EXISTS
3.6.1.3.
ALTER INDEX
3.6.1.3.1.
ALTER INDEX .. RENAME
3.6.1.3.2.
ALTER INDEX IF EXISTS
3.6.1.4.
ALTER SCHEMA
3.6.1.4.1.
ALTER SCHEMA .. RENAME
3.6.1.4.2.
ALTER SCHEMA IF EXISTS
3.6.1.5.
ALTER SEQUENCE
3.6.1.5.1.
ALTER SEQUENCE .. RENAME
3.6.1.5.2.
ALTER SEQUENCE .. CACHE
3.6.1.5.3.
ALTER SEQUENCE .. CYCLE
3.6.1.5.4.
ALTER SEQUENCE .. MINVALUE
3.6.1.5.5.
ALTER SEQUENCE .. t reaches its MAXVALUE
3.6.1.5.6.
ALTER SEQUENCE .. INCREMENT BY
3.6.1.5.7.
ALTER SEQUENCE .. START WITH
3.6.1.5.8.
ALTER SEQUENCE .. RESTART
3.6.1.5.9.
ALTER SEQUENCE IF EXISTS
3.6.1.6.
ALTER TABLE
3.6.1.6.1.
ALTER TABLE .. ADD COLUMN
3.6.1.6.2.
ALTER TABLE .. ADD COLUMN .. FIRST, BEFORE, AFTER
3.6.1.6.3.
ALTER TABLE .. ADD COLUMNS
3.6.1.6.4.
ALTER TABLE .. ADD COLUMN IF NOT EXISTS
3.6.1.6.5.
ALTER TABLE .. ADD PRIMARY KEY
3.6.1.6.6.
ALTER TABLE .. ADD UNIQUE
3.6.1.6.7.
ALTER TABLE .. ADD FOREIGN KEY
3.6.1.6.8.
ALTER TABLE .. ADD CHECK
3.6.1.6.9.
ALTER TABLE .. RENAME
3.6.1.6.10.
ALTER TABLE .. COMMENT
3.6.1.6.11.
ALTER TABLE .. ALTER COLUMN .. SET DEFAULT
3.6.1.6.12.
ALTER TABLE .. ALTER COLUMN .. DROP DEFAULT
3.6.1.6.13.
ALTER TABLE .. ALTER COLUMN .. SET NOT NULL
3.6.1.6.14.
ALTER TABLE .. ALTER COLUMN .. DROP NOT NULL
3.6.1.6.15.
ALTER TABLE .. ALTER COLUMN .. SET TYPE
3.6.1.6.16.
ALTER TABLE .. ALTER CONSTRAINT .. ENFORCED
3.6.1.6.17.
ALTER TABLE .. ALTER CONSTRAINT .. NOT ENFORCED
3.6.1.6.18.
ALTER TABLE .. RENAME COLUMN
3.6.1.6.19.
ALTER TABLE .. RENAME CONSTRAINT
3.6.1.6.20.
ALTER TABLE .. RENAME INDEX
3.6.1.6.21.
ALTER TABLE .. DROP COLUMN
3.6.1.6.22.
ALTER TABLE .. DROP COLUMN RESTRICT
3.6.1.6.23.
ALTER TABLE .. DROP COLUMN CASCADE
3.6.1.6.24.
ALTER TABLE .. DROP COLUMNS
3.6.1.6.25.
ALTER TABLE .. ADD COLUMN IF NOT EXISTS
3.6.1.6.26.
ALTER TABLE .. DROP CONSTRAINT
3.6.1.6.27.
ALTER TABLE .. DROP PRIMARY KEY
3.6.1.6.28.
ALTER TABLE .. DROP UNIQUE
3.6.1.6.29.
ALTER TABLE .. DROP FOREIGN KEY
3.6.1.6.30.
ALTER TABLE .. DROP CONSTRAINT IF EXISTS
3.6.1.6.31.
ALTER TABLE IF EXISTS
3.6.1.7.
ALTER TYPE
3.6.1.7.1.
ALTER TYPE .. RENAME
3.6.1.7.2.
ALTER TYPE .. for enum alterations
3.6.1.7.3.
ALTER TYPE IF EXISTS
3.6.1.8.
ALTER VIEW
3.6.1.8.1.
ALTER VIEW .. AS
3.6.1.8.2.
ALTER VIEW .. COMMENT
3.6.1.8.3.
ALTER VIEW .. RENAME
3.6.1.8.4.
ALTER VIEW IF EXISTS
3.6.2.
The COMMENT statement
3.6.2.1.
COMMENT ON TABLE
3.6.2.2.
COMMENT ON VIEW
3.6.2.3.
COMMENT ON MATERIALIZED VIEW
3.6.2.4.
COMMENT ON COLUMN
3.6.3.
The CREATE statement
3.6.3.1.
CREATE DATABASE
3.6.3.2.
CREATE DOMAIN
3.6.3.3.
CREATE FUNCTION
3.6.3.3.1.
Scalar functions
3.6.3.3.2.
CREATE OR REPLACE FUNCTION
3.6.3.3.3.
SQL data access characteristics
3.6.3.3.4.
DETERMINISTIC characteristic
3.6.3.3.5.
ON NULL INPUT characteristic
3.6.3.4.
CREATE INDEX
3.6.3.5.
CREATE PROCEDURE
3.6.3.5.1.
CREATE OR REPLACE PROCEDURE
3.6.3.5.2.
SQL data access characteristics
3.6.3.6.
CREATE SCHEMA
3.6.3.7.
CREATE SEQUENCE
3.6.3.7.1.
CREATE SEQUENCE IF NOT EXISTS
3.6.3.7.2.
CREATE SEQUENCE .. AS (new)
3.6.3.7.3.
CREATE SEQUENCE .. CACHE
3.6.3.7.4.
CREATE SEQUENCE .. CYCLE
3.6.3.7.5.
CREATE SEQUENCE .. MINVALUE
3.6.3.7.6.
CREATE SEQUENCE .. MAXVALUE
3.6.3.7.7.
CREATE SEQUENCE .. INCREMENT BY
3.6.3.7.8.
CREATE SEQUENCE .. START WITH
3.6.3.8.
CREATE SYNONYM (new)
3.6.3.8.1.
CREATE OR REPLACE SYNONYM (new)
3.6.3.9.
CREATE TABLE
3.6.3.9.1.
Columns
3.6.3.9.2.
Nullability
3.6.3.9.3.
Defaults
3.6.3.9.4.
Identities
3.6.3.9.5.
Computed columns
3.6.3.9.6.
Primary key
3.6.3.9.7.
Unique constraints
3.6.3.9.8.
Foreign keys
3.6.3.9.9.
Check constraints
3.6.3.9.10.
From a SELECT
3.6.3.9.11.
Temporary tables
3.6.3.10.
CREATE TRIGGER
3.6.3.10.1.
Events
3.6.3.10.2.
REFERENCING clause
3.6.3.10.3.
STATEMENT vs ROW triggers
3.6.3.10.4.
WHEN clause
3.6.3.11.
CREATE TYPE .. AS ENUM
3.6.3.12.
CREATE TYPE .. AS OBJECT
3.6.3.13.
CREATE VIEW
3.6.3.13.1.
CREATE OR REPLACE VIEW
3.6.3.13.2.
WITH CHECK OPTION
3.6.3.13.3.
WITH READ ONLY
3.6.3.13.4.
MATERIALIZED
3.6.4.
The DROP statement
3.6.4.1.
DROP DATABASE
3.6.4.1.1.
DROP DATABASE IF EXISTS
3.6.4.2.
DROP DOMAIN
3.6.4.2.1.
DROP DOMAIN IF EXISTS
3.6.4.3.
DROP FUNCTION
3.6.4.3.1.
DROP FUNCTION IF EXISTS
3.6.4.4.
DROP INDEX
3.6.4.4.1.
DROP INDEX IF EXISTS
3.6.4.5.
DROP PROCEDURE
3.6.4.5.1.
DROP PROCEDURE IF EXISTS
3.6.4.6.
DROP SCHEMA
3.6.4.6.1.
DROP SCHEMA IF EXISTS
3.6.4.7.
DROP SEQUENCE
3.6.4.7.1.
DROP SEQUENCE IF EXISTS
3.6.4.8.
DROP SYNONYM (new)
3.6.4.8.1.
DROP SYNONYM IF EXISTS (new)
3.6.4.9.
DROP TABLE
3.6.4.9.1.
DROP TABLE IF EXISTS
3.6.4.10.
DROP TRIGGER
3.6.4.10.1.
DROP TRIGGER IF EXISTS
3.6.4.11.
DROP TYPE
3.6.4.11.1.
DROP TYPE IF EXISTS
3.6.4.12.
DROP VIEW
3.6.4.12.1.
DROP VIEW IF EXISTS
3.6.4.12.2.
DROP MATERIALIZED VIEW
3.6.5.
The GRANT statement
3.6.6.
The REVOKE statement
3.6.7.
The SET statement
3.6.7.1.
SET CATALOG
3.6.7.2.
SET SCHEMA
3.6.8.
The TRUNCATE statement
3.6.9.
Generating DDL from objects
3.7.
Transactional statements
3.7.1.
START TRANSACTION statement
3.7.2.
COMMIT statement
3.7.3.
ROLLBACK statement
3.7.4.
SAVEPOINT statement
3.7.5.
RELEASE SAVEPOINT statement
3.8.
Procedural statements
3.8.1.
Block statement
3.8.2.
CALL statement
3.8.3.
CONTINUE statement
3.8.4.
EXECUTE statement
3.8.5.
EXIT statement
3.8.6.
FOR statement
3.8.7.
GOTO statement
3.8.8.
IF statement
3.8.9.
Labels
3.8.10.
LOOP statement
3.8.11.
REPEAT statement
3.8.12.
SIGNAL
3.8.13.
Variables
3.8.14.
WHILE statement
3.9.
Catalog and schema expressions
3.10.
Table expressions
3.10.1.
Generated Tables
3.10.2.
Aliased Tables
3.10.2.1.
Aliased generated tables
3.10.2.2.
Aliased table expressions
3.10.2.3.
Aliased joined tables
3.10.2.4.
Derived column lists
3.10.2.5.
Unnamed derived tables
3.10.3.
Joined tables
3.10.3.1.
CROSS JOIN
3.10.3.2.
INNER JOIN
3.10.3.3.
OUTER JOIN
3.10.3.4.
SEMI JOIN
3.10.3.5.
ANTI JOIN
3.10.3.6.
ON clause
3.10.3.7.
ON KEY clause
3.10.3.8.
USING clause
3.10.3.9.
NATURAL clause
3.10.3.10.
LATERAL
3.10.3.11.
APPLY
3.10.3.12.
PARTITION BY
3.10.3.13.
JOIN hints
3.10.3.13.1.
HASH JOIN
3.10.3.13.2.
LOOP JOIN
3.10.3.13.3.
MERGE JOIN
3.10.4.
The VALUES() table constructor
3.10.5.
Derived tables
3.10.6.
Inline derived tables
3.10.7.
The Oracle PIVOT clause
3.10.8.
Relational division
3.10.9.
Array and cursor unnesting
3.10.10.
Table-valued functions
3.10.11.
GENERATE_SERIES
3.10.12.
WITH ORDINALITY
3.10.13.
JSON_TABLE
3.10.14.
XMLTABLE
3.10.15.
The DUAL table
3.10.16.
Temporal tables
3.10.17.
Data change delta tables
3.11.
Column expressions
3.11.1.
Table columns
3.11.1.1.
Generated table columns
3.11.1.2.
Dereferenced table columns
3.11.1.3.
Named table columns
3.11.2.
Aliased columns
3.11.3.
Cast expressions
3.11.4.
Cast expressions (with TRY_CAST)
3.11.5.
Datatype coercions
3.11.6.
Hidden columns (new)
3.11.7.
Readonly columns
3.11.8.
Computed columns
3.11.9.
Collations
3.11.10.
Arithmetic expressions
3.11.11.
String concatenation
3.11.12.
Case sensitivity with strings
3.11.13.
General functions
3.11.13.1.
CHOOSE
3.11.13.2.
COALESCE
3.11.13.3.
DECODE
3.11.13.4.
IIF
3.11.13.5.
NULLIF
3.11.13.6.
NVL
3.11.13.7.
NVL2
3.11.14.
Numeric functions
3.11.14.1.
ABS
3.11.14.2.
ACOS
3.11.14.3.
ASIN
3.11.14.4.
ATAN
3.11.14.5.
ATAN2
3.11.14.6.
CEIL
3.11.14.7.
COS
3.11.14.8.
COSH
3.11.14.9.
COT
3.11.14.10.
COTH
3.11.14.11.
DEG
3.11.14.12.
E
3.11.14.13.
EXP
3.11.14.14.
FLOOR
3.11.14.15.
GREATEST
3.11.14.16.
LEAST
3.11.14.17.
LN
3.11.14.18.
LOG
3.11.14.19.
LOG10
3.11.14.20.
NEG
3.11.14.21.
PI
3.11.14.22.
POWER
3.11.14.23.
RAD
3.11.14.24.
RAND
3.11.14.25.
ROUND
3.11.14.26.
SIGN
3.11.14.27.
SIN
3.11.14.28.
SINH
3.11.14.29.
SQRT
3.11.14.30.
SQUARE
3.11.14.31.
TAN
3.11.14.32.
TANH
3.11.14.33.
TRUNC
3.11.14.34.
WIDTH_BUCKET
3.11.15.
Bitwise functions
3.11.15.1.
BIT_AND
3.11.15.2.
BIT_COUNT
3.11.15.3.
BIT_GET
3.11.15.4.
BIT_NAND
3.11.15.5.
BIT_NOR
3.11.15.6.
BIT_NOT
3.11.15.7.
BIT_OR
3.11.15.8.
BIT_SET
3.11.15.9.
BIT_XNOR
3.11.15.10.
BIT_XOR
3.11.15.11.
SHL
3.11.15.12.
SHR
3.11.16.
String functions
3.11.16.1.
ASCII
3.11.16.2.
BIN_TO_UUID (new)
3.11.16.3.
BIT_LENGTH
3.11.16.4.
CHR
3.11.16.5.
CONCAT (|| operator)
3.11.16.6.
DIGITS
3.11.16.7.
LEFT
3.11.16.8.
LENGTH
3.11.16.9.
LOWER
3.11.16.10.
LPAD
3.11.16.11.
LTRIM
3.11.16.12.
MD5
3.11.16.13.
MID
3.11.16.14.
OCTET_LENGTH
3.11.16.15.
OVERLAY
3.11.16.16.
POSITION
3.11.16.17.
REGEXP_REPLACE
3.11.16.18.
REPEAT
3.11.16.19.
REPLACE
3.11.16.20.
REVERSE
3.11.16.21.
RIGHT
3.11.16.22.
RPAD
3.11.16.23.
RTRIM
3.11.16.24.
SPACE
3.11.16.25.
SPLIT_PART
3.11.16.26.
SUBSTRING
3.11.16.27.
SUBSTRING_INDEX
3.11.16.28.
TO_CHAR
3.11.16.29.
TO_HEX
3.11.16.30.
TRANSLATE
3.11.16.31.
TRIM
3.11.16.32.
UPPER
3.11.16.33.
UUID
3.11.16.34.
UUID_TO_BIN (new)
3.11.17.
Binary functions (new)
3.11.17.1.
BIT_LENGTH (binary) (new)
3.11.17.2.
CONCAT (binary, || operator) (new)
3.11.17.3.
LENGTH (binary) (new)
3.11.17.4.
LTRIM (binary) (new)
3.11.17.5.
MD5 (binary) (new)
3.11.17.6.
OCTET_LENGTH (binary) (new)
3.11.17.7.
OVERLAY (binary) (new)
3.11.17.8.
POSITION (binary) (new)
3.11.17.9.
RTRIM (binary) (new)
3.11.17.10.
TRIM (binary) (new)
3.11.18.
Datetime functions
3.11.18.1.
CENTURY
3.11.18.2.
CURRENT_DATE
3.11.18.3.
CURRENT_LOCALDATE
3.11.18.4.
CURRENT_LOCALDATETIME
3.11.18.5.
CURRENT_LOCALTIME
3.11.18.6.
CURRENT_OFFSETDATETIME
3.11.18.7.
CURRENT_OFFSETTIME
3.11.18.8.
CURRENT_TIME
3.11.18.9.
CURRENT_TIMESTAMP
3.11.18.10.
DATE
3.11.18.11.
DATEADD
3.11.18.12.
DATEDIFF
3.11.18.13.
DATESUB
3.11.18.14.
DAY
3.11.18.15.
DAY_OF_YEAR
3.11.18.16.
DECADE
3.11.18.17.
EPOCH
3.11.18.18.
EXTRACT
3.11.18.19.
HOUR
3.11.18.20.
ISO_DAY_OF_WEEK
3.11.18.21.
LOCALDATE
3.11.18.22.
LOCALDATEADD
3.11.18.23.
LOCALDATESUB
3.11.18.24.
LOCALDATETIME
3.11.18.25.
LOCALDATETIMEADD
3.11.18.26.
LOCALDATETIMESUB
3.11.18.27.
LOCALTIME
3.11.18.28.
MILLENNIUM
3.11.18.29.
MINUTE
3.11.18.30.
MONTH
3.11.18.31.
QUARTER
3.11.18.32.
SECOND
3.11.18.33.
TIME
3.11.18.34.
TIMESTAMP
3.11.18.35.
TIMESTAMPADD
3.11.18.36.
TIMESTAMPSUB
3.11.18.37.
TO_DATE
3.11.18.38.
TO_LOCALDATE
3.11.18.39.
TO_LOCALDATETIME
3.11.18.40.
TO_TIMESTAMP
3.11.18.41.
TRUNC
3.11.18.42.
YEAR
3.11.19.
ARRAY functions
3.11.19.1.
ARRAY_ALL_MATCH (new)
3.11.19.2.
ARRAY_ANY_MATCH (new)
3.11.19.3.
ARRAY_APPEND (|| operator)
3.11.19.4.
ARRAY_CONCAT (|| operator)
3.11.19.5.
ARRAY_FILTER (new)
3.11.19.6.
ARRAY_GET
3.11.19.7.
ARRAY_MAP (new)
3.11.19.8.
ARRAY_NONE_MATCH (new)
3.11.19.9.
ARRAY_OVERLAP
3.11.19.10.
ARRAY_PREPEND (|| operator)
3.11.19.11.
ARRAY_REMOVE
3.11.19.12.
ARRAY_REPLACE
3.11.19.13.
ARRAY constructor
3.11.19.14.
ARRAY constructor from subquery
3.11.19.15.
CARDINALITY
3.11.20.
JSON functions
3.11.20.1.
JSON_ARRAY
3.11.20.2.
JSON_ARRAY_LENGTH (new)
3.11.20.3.
JSON_INSERT
3.11.20.4.
JSON_KEY_EXISTS (new)
3.11.20.5.
JSON_KEYS
3.11.20.6.
JSON_OBJECT
3.11.20.7.
JSON_REMOVE
3.11.20.8.
JSON_REPLACE
3.11.20.9.
JSON_SET
3.11.20.10.
JSON_VALUE
3.11.20.11.
JSON array element access with -> or ->>
3.11.20.12.
JSON object attribute access with -> or ->>
3.11.21.
XML functions
3.11.21.1.
XMLATTRIBUTES
3.11.21.2.
XMLCOMMENT
3.11.21.3.
XMLCONCAT
3.11.21.4.
XMLDOCUMENT
3.11.21.5.
XMLELEMENT
3.11.21.6.
XMLFOREST
3.11.21.7.
XMLPARSE
3.11.21.8.
XMLPI
3.11.21.9.
XMLQUERY
3.11.21.10.
XMLSERIALIZE
3.11.22.
System functions
3.11.22.1.
CURRENT_SCHEMA
3.11.22.2.
CURRENT_USER
3.11.23.
Spatial functions
3.11.23.1.
ST_Area
3.11.23.2.
ST_AsText
3.11.23.3.
ST_Boundary (new)
3.11.23.4.
ST_Centroid
3.11.23.5.
ST_Difference
3.11.23.6.
ST_Dimension (new)
3.11.23.7.
ST_Distance
3.11.23.8.
ST_EndPoint
3.11.23.9.
ST_ExteriorRing
3.11.23.10.
ST_GeometryN
3.11.23.11.
ST_GeometryType
3.11.23.12.
ST_GeomFromText
3.11.23.13.
ST_InteriorRingN
3.11.23.14.
ST_Intersection
3.11.23.15.
ST_Length
3.11.23.16.
ST_NumGeometries
3.11.23.17.
ST_NumInteriorRings
3.11.23.18.
ST_NumPoints
3.11.23.19.
ST_Perimeter (new)
3.11.23.20.
ST_PointN
3.11.23.21.
ST_SRID
3.11.23.22.
ST_StartPoint
3.11.23.23.
ST_Transform (new)
3.11.23.24.
ST_Union
3.11.23.25.
ST_X
3.11.23.26.
ST_XMax (new)
3.11.23.27.
ST_XMin (new)
3.11.23.28.
ST_Y
3.11.23.29.
ST_YMax (new)
3.11.23.30.
ST_YMin (new)
3.11.23.31.
ST_Z
3.11.23.32.
ST_ZMax (new)
3.11.23.33.
ST_ZMin (new)
3.11.24.
Aggregate functions
3.11.24.1.
Grouping
3.11.24.2.
Distinctness
3.11.24.3.
Filtering
3.11.24.4.
Ordering
3.11.24.5.
Ordering WITHIN GROUP
3.11.24.6.
Keeping
3.11.24.7.
ANY_VALUE
3.11.24.8.
ARRAY_AGG
3.11.24.9.
AVG
3.11.24.10.
LISTAGG (binary) (new)
3.11.24.11.
BIT_AND_AGG
3.11.24.12.
BIT_NAND_AGG
3.11.24.13.
BIT_NOR_AGG
3.11.24.14.
BIT_OR_AGG
3.11.24.15.
BIT_XOR_AGG
3.11.24.16.
BIT_XNOR_AGG
3.11.24.17.
BOOL_AND
3.11.24.18.
BOOL_OR
3.11.24.19.
COLLECT
3.11.24.20.
COUNT
3.11.24.21.
CUME_DIST
3.11.24.22.
DENSE_RANK
3.11.24.23.
EVERY
3.11.24.24.
GROUP_CONCAT
3.11.24.25.
JSON_ARRAYAGG
3.11.24.26.
JSON_OBJECTAGG
3.11.24.27.
LISTAGG
3.11.24.28.
MAX
3.11.24.29.
MAX_BY (new)
3.11.24.30.
MEDIAN
3.11.24.31.
MIN
3.11.24.32.
MIN_BY (new)
3.11.24.33.
MODE
3.11.24.34.
MULTISET_AGG
3.11.24.35.
PERCENT_RANK
3.11.24.36.
PERCENTILE_CONT
3.11.24.37.
PERCENTILE_DISC
3.11.24.38.
PRODUCT
3.11.24.39.
RANK
3.11.24.40.
SUM
3.11.24.41.
XMLAGG
3.11.25.
Window functions
3.11.25.1.
PARTITION BY
3.11.25.2.
ORDER BY
3.11.25.3.
ROWS, RANGE, GROUPS (frame clause)
3.11.25.4.
EXCLUDE
3.11.25.5.
NULL treatment
3.11.25.6.
FROM FIRST, FROM LAST
3.11.25.7.
Nested aggregate functions
3.11.25.8.
Window aggregation
3.11.25.9.
Window ordered aggregate
3.11.25.10.
ROW_NUMBER
3.11.25.11.
RANK
3.11.25.12.
DENSE_RANK
3.11.25.13.
PERCENT_RANK
3.11.25.14.
CUME_DIST
3.11.25.15.
NTILE
3.11.25.16.
LEAD
3.11.25.17.
LAG
3.11.25.18.
FIRST_VALUE
3.11.25.19.
LAST_VALUE
3.11.25.20.
NTH_VALUE
3.11.26.
User-defined functions
3.11.27.
User-defined aggregate functions
3.11.28.
User-defined type attribute paths
3.11.29.
The CASE expression
3.11.30.
Sequences and serials
3.11.31.
Scalar subqueries
3.11.32.
ARRAY value constructor
3.11.33.
MULTISET value constructor
3.11.34.
Tuples or row value expressions
3.11.35.
Nested records
3.12.
Conditional expressions
3.12.1.
Condition building
3.12.2.
TRUE and FALSE condition
3.12.3.
BOOLEAN columns
3.12.4.
AND, OR, NOT boolean operators
3.12.5.
Boolean operator precedence
3.12.6.
XOR boolean operator
3.12.7.
Comparison predicate
3.12.8.
Comparison predicate (degree > 1)
3.12.9.
Quantified comparison predicate
3.12.10.
BETWEEN predicate
3.12.11.
BETWEEN predicate (degree > 1)
3.12.12.
LIKE predicate (binary) (new)
3.12.13.
DISTINCT predicate
3.12.14.
DISTINCT predicate (degree > 1)
3.12.15.
DOCUMENT predicate
3.12.16.
EXISTS predicate
3.12.17.
IN predicate
3.12.18.
IN predicate (degree > 1)
3.12.19.
JSON predicate
3.12.20.
JSON_EXISTS predicate
3.12.21.
LIKE predicate
3.12.22.
Quantified LIKE predicate
3.12.23.
NULL predicate
3.12.24.
NULL predicate (degree > 1)
3.12.25.
OVERLAPS predicate
3.12.26.
SIMILAR TO predicate
3.12.27.
Spatial predicates
3.12.27.1.
ST_Contains
3.12.27.2.
ST_Crosses
3.12.27.3.
ST_Disjoint
3.12.27.4.
ST_Equals
3.12.27.5.
ST_Intersects
3.12.27.6.
ST_IsClosed
3.12.27.7.
ST_IsEmpty
3.12.27.8.
ST_IsRing (new)
3.12.27.9.
ST_IsSimple (new)
3.12.27.10.
ST_IsValid (new)
3.12.27.11.
ST_Overlaps
3.12.27.12.
ST_Touches
3.12.27.13.
ST_Within
3.12.28.
UNIQUE predicate
3.12.29.
XMLEXISTS predicate
3.12.30.
Query By Example (QBE)
3.13.
Operator precedence
3.14.
Synthetic SQL clauses
3.15.
Dynamic SQL
3.15.1.
Optional column expressions
3.15.2.
Optional conditional expressions
3.15.3.
Optional conditional tables
3.16.
Plain SQL
3.17.
Plain SQL Templating Language
3.18.
Plain SQL raw templates
3.19.
Hints
3.19.1.
MySQL hints
3.19.1.1.
Index hints
3.19.1.2.
STRAIGHT_JOIN
3.19.1.3.
Oracle style hints in MySQL
3.19.2.
Oracle hints
3.19.3.
SQL Server hints
3.19.3.1.
WITH
3.19.3.2.
OPTION
3.20.
SQL Parser
3.20.1.
SQL Parser API
3.20.2.
SQL Parser CLI
3.20.3.
SQL Parser Listener
3.20.4.
SQL translator
3.20.5.
SQL Parser Grammar
3.21.
SQL interpreter
3.22.
Schema diff
3.23.
Schema diff CLI
3.24.
Names and identifiers
3.25.
Bind values and parameters
3.25.1.
Indexed parameters
3.25.2.
Named parameters
3.25.3.
Inlined parameters
3.25.4.
SQL injection
3.26.
QueryParts
3.26.1.
SQL rendering
3.26.2.
Declaration vs reference
3.26.3.
Pretty printing SQL
3.26.4.
Variable binding
3.26.5.
Custom data type bindings
3.26.6.
Custom syntax elements
3.26.7.
Plain SQL QueryParts
3.26.8.
Serializability
3.26.9.
SQL transformation
3.26.9.1.
ANSI JOIN to table lists
3.26.9.2.
Table lists to ANSI JOIN
3.26.9.3.
ROWNUM to LIMIT
3.26.9.4.
QUALIFY to derived table
3.26.9.5.
IN condition subquery with LIMIT to derived table
3.26.9.6.
GROUP BY <column index>
3.26.9.7.
Inline CTE
3.26.9.8.
Unnecessary arithmetic expressions
3.26.9.9.
Pattern based transformation
3.26.9.9.1.
AND to NOT IN
3.26.9.9.2.
Arithmetic comparisons
3.26.9.9.3.
Arithmetic expressions
3.26.9.9.4.
BIT_GET function
3.26.9.9.5.
BIT_SET function
3.26.9.9.6.
CASE searched to CASE simple
3.26.9.9.7.
CASE to CASE abbreviation
3.26.9.9.8.
CASE with DISTINCT FROM to DECODE
3.26.9.9.9.
CASE with ELSE NULL
3.26.9.9.10.
COUNT(*) scalar subquery comparison
3.26.9.9.11.
COUNT(const)
3.26.9.9.12.
COUNT(expr) scalar subquery comparison
3.26.9.9.13.
DISTINCT FROM NULL
3.26.9.9.14.
Empty scalar subquery
3.26.9.9.15.
Flatten CASE
3.26.9.9.16.
Flatten CASE abbreviations
3.26.9.9.17.
Flatten DECODE
3.26.9.9.18.
Hyperbolic functions
3.26.9.9.19.
Idempotent function repetition
3.26.9.9.20.
Inverse hyperbolic functions
3.26.9.9.21.
Logarithmic functions
3.26.9.9.22.
Merge AND predicates
3.26.9.9.23.
Merge BIT_NOT with BIT_NAND
3.26.9.9.24.
Merge BIT_NOT with BIT_NOR
3.26.9.9.25.
Merge BIT_NOT with BIT_XNOR
3.26.9.9.26.
Merge CASE .. WHEN and ELSE clauses
3.26.9.9.27.
Merge CASE .. WHEN clauses
3.26.9.9.28.
Merge IN predicates
3.26.9.9.29.
Merge NOT with comparison predicates
3.26.9.9.30.
Merge NOT with DISTINCT predicate
3.26.9.9.31.
Merge OR predicates
3.26.9.9.32.
Merge range predicates
3.26.9.9.33.
Normalise associative operations
3.26.9.9.34.
Normalise fields compared to values
3.26.9.9.35.
Normalise IN list with single element to comparison
3.26.9.9.36.
NOT AND
3.26.9.9.37.
NOT OR
3.26.9.9.38.
NULL ON NULL INPUT
3.26.9.9.39.
OR to IN
3.26.9.9.40.
Repeated arithmetic negation
3.26.9.9.41.
Repeated bitwise negation
3.26.9.9.42.
Repeated NOT
3.26.9.9.43.
Simplify CASE abbreviations
3.26.9.9.44.
Trigonometric functions
3.26.9.9.45.
Trim
3.26.9.9.46.
Trivial bitwise operations
3.26.9.9.47.
Trivial CASE abbreviations
3.26.9.9.48.
Trivial predicates
3.26.9.9.49.
Unnecessary DISTINCT
3.26.9.9.50.
Unnecessary EXISTS subquery clauses
3.26.9.9.51.
Unnecessary GROUP BY expressions
3.26.9.9.52.
Unnecessary INNER JOIN
3.26.9.9.53.
Unnecessary ORDER BY expressions
3.26.9.9.54.
Unnecessary scalar subquery
3.26.9.9.55.
Unreachable CASE clauses
3.26.9.9.56.
Unreachable DECODE clauses
3.26.10.
Custom SQL transformation with VisitListener
3.26.10.1.
Example: Logging abbreviated bind values
3.26.11.
Policies
3.26.11.1.
Configuration
3.26.11.2.
Implementation
3.26.11.3.
Inheritance
3.26.11.4.
Security considerations
3.27.
Zero-based vs one-based APIs
3.28.
SQL building in Kotlin
3.28.1.
Kotlin MULTISET Collectors
3.28.2.
Kotlin ResultQuery Collectors
3.28.3.
Kotlin BOOLEAN value expressions
3.28.4.
Kotlin ARRAY access
3.28.5.
Kotlin JSON access
3.28.6.
Kotlin coroutine support
3.29.
SQL building in Scala

previous : next

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo