Expressing SELECT statements
In this section, we will express/write via jOOQ DSL syntax a wide range of SELECT
statements, including common projections, popular subqueries, scalar and correlated subqueries, unions, and row value expressions. We'll start with the commonly used projections.
Expressing commonly used projections
By commonly used projections, we understand the projections written against the well-known dummy table, DUAL
. As you most probably know, the DUAL
table is specific to Oracle; it's mostly unnecessary in MySQL (although jOOQ still renders it for MySQL 5.7 compatibility) and doesn't exist in PostgreSQL and SQL Server.
In this context, even if the SQL standard requires a FROM
clause, jOOQ never requires such a clause and it renders the DUAL
table whenever it is needed/supported. For example, selecting 0 and 1 can be done via the selectZero()
and selectOne()
methods (these statics are available in org.jooq.impl.DSL
). The latter (selectOne()
)...