select

fun select(expression: Expression<*>, vararg expressions: Expression<*>): Query

Creates a SELECT Query without a FROM clause.

Some queries without a FROM clause are valid, such as select(intLiteral(1)). Others are not. For example, select(MyTable.id) is rejected by the database during execution because MyTable is not a query source.

For instance SELECT 1 can be written as follows:

val one = intLiteral(1)
val result = select(one).single()[one]

fun select(expressions: List<Expression<*>>): Query

Creates a SELECT Query without a FROM clause.

Some queries without a FROM clause are valid, such as select(listOf(intLiteral(1))). Others are not. For example, select(listOf(MyTable.id)) is rejected by the database during execution because MyTable is not a query source.

val one = intLiteral(1)
val status = stringLiteral("ready")
val result = select(listOf(one, status)).single()

Throws


fun ColumnSet.select(column: Expression<*>, vararg columns: Expression<*>): Query

Creates a SELECT Query by selecting either a single column, or a subset of columns, from this ColumnSet.

The column set selected from may be either a Table or a Join. Arguments provided to column and columns may be table object columns or function expressions.

Samples

org.jetbrains.exposed.v1.r2dbc.sql.tests.shared.AliasesTests.testJoinSubQuery01
fun ColumnSet.select(columns: List<Expression<*>>): Query

Creates a SELECT Query using a list of columns or expressions from this ColumnSet.

The column set selected from may be either a Table or a Join.