Top Description Methods
org.jooq

public non-sealed Interface Select<R extends org.jooq.Record>

extends ResultQuery<R extends Record>, TableLike<R extends Record>, FieldLike, FieldOrRowOrSelect
Known Direct Subinterfaces
org.jooq.SelectFinalStep, org.jooq.SelectQuery
Type Parameters
<R>
The record type being returned by this query
Static Imports
org.jooq.SQLDialect.CUBRID, .SQLDialect.DERBY, .SQLDialect.H2, .SQLDialect.HSQLDB, .SQLDialect.IGNITE, .SQLDialect.MARIADB, .SQLDialect.MYSQL, .SQLDialect.POSTGRES, .SQLDialect.SQLITE, .SQLDialect.YUGABYTEDB

A SELECT statement.

Example:


// Assuming import static org.jooq.impl.DSL.*;

using(configuration)
   .select(ACTOR.FIRST_NAME, ACTOR.LAST_NAME)
   .from(ACTOR)
   .fetch();

Instances can be created using DSL#select(SelectFieldOrAsterisk...), or DSLContext#selectQuery() and overloads.

Author
Lukas Eder

Method Summary

Modifier and TypeMethod and Description
public boolean
$distinct()

Experimental query object model accessor method, see also QOM.

public @NotNull Select<R>
$distinct(boolean newDistinct)

Experimental query object model accessor method, see also QOM.

public @NotNull QOM.UnmodifiableList<? extends SelectFieldOrAsterisk>
$distinctOn()

Experimental query object model accessor method, see also QOM.

public @NotNull Select<R>
$distinctOn(Collection<? extends SelectFieldOrAsterisk> newDistinctOn)

Experimental query object model accessor method, see also QOM.

public @NotNull QOM.UnmodifiableList<? extends Table<?>>
$from()

Experimental query object model accessor method, see also QOM.

public @NotNull Select<R>
$from(Collection<? extends Table<?>> newFrom)

Experimental query object model accessor method, see also QOM.

public @NotNull QOM.UnmodifiableList<? extends GroupField>
$groupBy()

Experimental query object model accessor method, see also QOM.

public @NotNull Select<R>
$groupBy(Collection<? extends GroupField> newGroupBy)

Experimental query object model accessor method, see also QOM.

public boolean
$groupByDistinct()

Experimental query object model accessor method, see also QOM.

public @NotNull Select<R>
$groupByDistinct(boolean newGroupByDistinct)

Experimental query object model accessor method, see also QOM.

public @Nullable Condition
$having()

Deprecated as a consequence of Condition being deprecated.
Experimental query object model accessor method, see also QOM.
public @NotNull Select<R>
$having(Condition newHaving)

Deprecated as a consequence of Condition being deprecated.
Experimental query object model accessor method, see also QOM.
public @Nullable Field<? extends Number>
$limit()

Deprecated as a consequence of Field being deprecated.
Experimental query object model accessor method, see also QOM.
public @NotNull Select<R>
$limit(Field<? extends Number> newLimit)

Deprecated as a consequence of Field being deprecated.
Experimental query object model accessor method, see also QOM.
public boolean
$limitPercent()

Experimental query object model accessor method, see also QOM.

public @NotNull Select<R>
$limitPercent(boolean newLimitPercent)

Experimental query object model accessor method, see also QOM.

public boolean
$limitWithTies()

Experimental query object model accessor method, see also QOM.

public @NotNull Select<R>
$limitWithTies(boolean newLimitWithTies)

Experimental query object model accessor method, see also QOM.

public @Nullable Field<? extends Number>
$offset()

Deprecated as a consequence of Field being deprecated.
Experimental query object model accessor method, see also QOM.
public @NotNull Select<R>
$offset(Field<? extends Number> newOffset)

Deprecated as a consequence of Field being deprecated.
Experimental query object model accessor method, see also QOM.
public @NotNull QOM.UnmodifiableList<? extends SortField<?>>
$orderBy()

Experimental query object model accessor method, see also QOM.

public @NotNull Select<R>
$orderBy(Collection<? extends SortField<?>> newOrderBy)

Experimental query object model accessor method, see also QOM.

public @Nullable Condition
$qualify()

Deprecated as a consequence of Condition being deprecated.
Experimental query object model accessor method, see also QOM.
public @NotNull Select<R>
$qualify(Condition newQualify)

Deprecated as a consequence of Condition being deprecated.
Experimental query object model accessor method, see also QOM.
public @NotNull QOM.UnmodifiableList<? extends SelectFieldOrAsterisk>
$select()

Experimental query object model accessor method, see also QOM.

public @NotNull Select<?>
$select(Collection<? extends SelectFieldOrAsterisk> newSelect)

Experimental query object model accessor method, see also QOM.

public @Nullable Condition
$where()

Deprecated as a consequence of Condition being deprecated.
Experimental query object model accessor method, see also QOM.
public @NotNull Select<R>
$where(Condition newWhere)

Deprecated as a consequence of Condition being deprecated.
Experimental query object model accessor method, see also QOM.
public @NotNull QOM.UnmodifiableList<? extends WindowDefinition>
$window()

Experimental query object model accessor method, see also QOM.

public @NotNull Select<R>
$window(Collection<? extends WindowDefinition> newWindow)

Experimental query object model accessor method, see also QOM.

public @Nullable QOM.With
$with()

Experimental query object model accessor method, see also QOM.

public @NotNull Select<?>
$with(QOM.With newWith)

Experimental query object model accessor method, see also QOM.

public @NotNull Select<R>
except(Select<? extends R> select)

Apply the EXCEPT (or MINUS) set operation.

public @NotNull Select<R>
exceptAll(Select<? extends R> select)

Apply the EXCEPT ALL set operation.

public @NotNull List<Field<?>>
getSelect()

All fields selected in this query

public @NotNull Select<R>
intersect(Select<? extends R> select)

Apply the INTERSECT set operation.

public @NotNull Select<R>
intersectAll(Select<? extends R> select)

Apply the INTERSECT ALL set operation.

public @NotNull Select<R>
union(Select<? extends R> select)

Apply the UNION set operation.

public @NotNull Select<R>
unionAll(Select<? extends R> select)

Apply the UNION ALL set operation.

Inherited from org.jooq.FieldLike:
asFieldasFieldasField
Inherited from org.jooq.ResultQuery:
bindbindcoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecoercecollectfetchfetchfetchfetchfetchfetchfetchfetchfetchfetchfetchfetchfetchfetchfetchAnyfetchAnyfetchAnyfetchAnyfetchAnyfetchAnyfetchAnyfetchAnyfetchAnyfetchAnyfetchAnyfetchAnyfetchAnyfetchAnyfetchAnyArrayfetchAnyIntofetchAnyIntofetchAnyMapfetchArrayfetchArrayfetchArrayfetchArrayfetchArrayfetchArrayfetchArrayfetchArrayfetchArrayfetchArrayfetchArrayfetchArrayfetchArrayfetchArraysfetchAsyncfetchAsyncfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchGroupsfetchIntofetchIntofetchIntofetchLazyfetchManyfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapfetchMapsfetchOnefetchOnefetchOnefetchOnefetchOnefetchOnefetchOnefetchOnefetchOnefetchOnefetchOnefetchOnefetchOnefetchOnefetchOneArrayfetchOneIntofetchOneIntofetchOneMapfetchOptionalfetchOptionalfetchOptionalfetchOptionalfetchOptionalfetchOptionalfetchOptionalfetchOptionalfetchOptionalfetchOptionalfetchOptionalfetchOptionalfetchOptionalfetchOptionalfetchOptionalArrayfetchOptionalIntofetchOptionalIntofetchOptionalMapfetchResultSetfetchSetfetchSetfetchSetfetchSetfetchSetfetchSetfetchSetfetchSetfetchSetfetchSetfetchSetfetchSetfetchSetfetchSinglefetchSinglefetchSinglefetchSinglefetchSinglefetchSinglefetchSinglefetchSinglefetchSinglefetchSinglefetchSinglefetchSinglefetchSinglefetchSinglefetchSingleArrayfetchSingleIntofetchSingleIntofetchSingleMapfetchSizefetchStreamfetchStreamIntofetchStreamIntoforEachgetRecordTypegetResultinterninterninterninterniteratorkeepStatementmaxRowspoolablequeryTimeoutresultSetConcurrencyresultSetHoldabilityresultSetTypespliteratorstream
Inherited from org.jooq.TableLike:
asMultisetasMultisetasMultisetasMultisetasTableasTableasTableasTableasTableasTableasTableasTableasTableasTableasTableasTable

Method Detail

$distinctback to summary
public boolean $distinct()

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
$distinctback to summary
public @NotNull Select<R> $distinct(boolean newDistinct)

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$distinctOnback to summary
public @NotNull QOM.UnmodifiableList<? extends SelectFieldOrAsterisk> $distinctOn()

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@NotNull
$distinctOnback to summary
public @NotNull Select<R> $distinctOn(Collection<? extends SelectFieldOrAsterisk> newDistinctOn)

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$fromback to summary
public @NotNull QOM.UnmodifiableList<? extends Table<?>> $from()

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@NotNull
$fromback to summary
public @NotNull Select<R> $from(Collection<? extends Table<?>> newFrom)

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$groupByback to summary
public @NotNull QOM.UnmodifiableList<? extends GroupField> $groupBy()

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@NotNull
$groupByback to summary
public @NotNull Select<R> $groupBy(Collection<? extends GroupField> newGroupBy)

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$groupByDistinctback to summary
public boolean $groupByDistinct()

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
$groupByDistinctback to summary
public @NotNull Select<R> $groupByDistinct(boolean newGroupByDistinct)

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$havingback to summary
public @Nullable Condition $having()

Deprecated

as a consequence of Condition being deprecated. See corresponding docs for further information.

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@Nullable
$havingback to summary
public @NotNull Select<R> $having(Condition newHaving)

Deprecated

as a consequence of Condition being deprecated. See corresponding docs for further information.

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$limitback to summary
public @Nullable Field<? extends Number> $limit()

Deprecated

as a consequence of Field being deprecated. See corresponding docs for further information.

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@Nullable
$limitback to summary
public @NotNull Select<R> $limit(Field<? extends Number> newLimit)

Deprecated

as a consequence of Field being deprecated. See corresponding docs for further information.

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$limitPercentback to summary
public boolean $limitPercent()

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
$limitPercentback to summary
public @NotNull Select<R> $limitPercent(boolean newLimitPercent)

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$limitWithTiesback to summary
public boolean $limitWithTies()

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
$limitWithTiesback to summary
public @NotNull Select<R> $limitWithTies(boolean newLimitWithTies)

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$offsetback to summary
public @Nullable Field<? extends Number> $offset()

Deprecated

as a consequence of Field being deprecated. See corresponding docs for further information.

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@Nullable
$offsetback to summary
public @NotNull Select<R> $offset(Field<? extends Number> newOffset)

Deprecated

as a consequence of Field being deprecated. See corresponding docs for further information.

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$orderByback to summary
public @NotNull QOM.UnmodifiableList<? extends SortField<?>> $orderBy()

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@NotNull
$orderByback to summary
public @NotNull Select<R> $orderBy(Collection<? extends SortField<?>> newOrderBy)

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$qualifyback to summary
public @Nullable Condition $qualify()

Deprecated

as a consequence of Condition being deprecated. See corresponding docs for further information.

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@Nullable
$qualifyback to summary
public @NotNull Select<R> $qualify(Condition newQualify)

Deprecated

as a consequence of Condition being deprecated. See corresponding docs for further information.

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$selectback to summary
public @NotNull QOM.UnmodifiableList<? extends SelectFieldOrAsterisk> $select()

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@NotNull
$selectback to summary
public @NotNull Select<?> $select(Collection<? extends SelectFieldOrAsterisk> newSelect)

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$whereback to summary
public @Nullable Condition $where()

Deprecated

as a consequence of Condition being deprecated. See corresponding docs for further information.

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@Nullable
$whereback to summary
public @NotNull Select<R> $where(Condition newWhere)

Deprecated

as a consequence of Condition being deprecated. See corresponding docs for further information.

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$windowback to summary
public @NotNull QOM.UnmodifiableList<? extends WindowDefinition> $window()

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@NotNull
$windowback to summary
public @NotNull Select<R> $window(Collection<? extends WindowDefinition> newWindow)

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
$withback to summary
public @Nullable QOM.With $with()

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@Nullable
$withback to summary
public @NotNull Select<?> $with(QOM.With newWith)

Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.

Annotations
@Experimental
@CheckReturnValue
@NotNull
exceptback to summary
public @NotNull Select<R> except(Select<? extends R> select)

Apply the EXCEPT (or MINUS) set operation.

Annotations
@NotNull
@CheckReturnValue
@Support:CUBRID, DERBY, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB
Exceptions
IllegalArgumentException:
If the argument select has the same identity as this select. The jOOQ 3.x API is mutable, which means that calls to the DSL API mutate this instance. Adding this instance as an set operation argument would lead to a StackOverflowError when generating the SQL.
exceptAllback to summary
public @NotNull Select<R> exceptAll(Select<? extends R> select)

Apply the EXCEPT ALL set operation.

Annotations
@NotNull
@CheckReturnValue
@Support:CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB
Exceptions
IllegalArgumentException:
If the argument select has the same identity as this select. The jOOQ 3.x API is mutable, which means that calls to the DSL API mutate this instance. Adding this instance as an set operation argument would lead to a StackOverflowError when generating the SQL.
getSelectback to summary
public @NotNull List<Field<?>> getSelect()

All fields selected in this query

Annotations
@NotNull
@CheckReturnValue
intersectback to summary
public @NotNull Select<R> intersect(Select<? extends R> select)

Apply the INTERSECT set operation.

Annotations
@NotNull
@CheckReturnValue
@Support:CUBRID, DERBY, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB
Exceptions
IllegalArgumentException:
If the argument select has the same identity as this select. The jOOQ 3.x API is mutable, which means that calls to the DSL API mutate this instance. Adding this instance as an set operation argument would lead to a StackOverflowError when generating the SQL.
intersectAllback to summary
public @NotNull Select<R> intersectAll(Select<? extends R> select)

Apply the INTERSECT ALL set operation.

Annotations
@NotNull
@CheckReturnValue
@Support:CUBRID, DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB
Exceptions
IllegalArgumentException:
If the argument select has the same identity as this select. The jOOQ 3.x API is mutable, which means that calls to the DSL API mutate this instance. Adding this instance as an set operation argument would lead to a StackOverflowError when generating the SQL.
unionback to summary
public @NotNull Select<R> union(Select<? extends R> select)

Apply the UNION set operation.

Annotations
@NotNull
@CheckReturnValue
@Support
Exceptions
IllegalArgumentException:
If the argument select has the same identity as this select. The jOOQ 3.x API is mutable, which means that calls to the DSL API mutate this instance. Adding this instance as an set operation argument would lead to a StackOverflowError when generating the SQL.
unionAllback to summary
public @NotNull Select<R> unionAll(Select<? extends R> select)

Apply the UNION ALL set operation.

Annotations
@NotNull
@CheckReturnValue
@Support
Exceptions
IllegalArgumentException:
If the argument select has the same identity as this select. The jOOQ 3.x API is mutable, which means that calls to the DSL API mutate this instance. Adding this instance as an set operation argument would lead to a StackOverflowError when generating the SQL.