CONCAT

infix fun KQLiteColumn<*>.CONCAT(literal: String): KQLiteColumn<String>

Concatenates two or more strings or columns together. This function corresponds to the SQLite CONCAT or || operator.

Example

// SELECT firstName || ' ' || lastName FROM Users;
select(Users.firstName CONCAT " " CONCAT Users.lastName).from(Users).execute()

Return

A new KQLiteColumn of type String representing the concatenation result.

Author

MOHAMMAD AZIM ANSARI

Parameters

literal

The value to concatenate.

See also


Concatenates this column with another column. This is an infix version of the CONCAT function, corresponding to the SQLite || operator.

Example

// SELECT firstName || ' ' || lastName FROM Users;
select(Users.firstName CONCAT " " CONCAT Users.lastName).from(Users).execute()

Return

A new KQLiteColumn of type String representing the concatenated result.

Author

MOHAMMAD AZIM ANSARI

Parameters

column

The column to concatenate with this column.

See also


fun CONCAT(vararg columns: KQLiteColumn<*>): KQLiteColumn<String>

Concatenates two or more strings or columns together.

This function corresponds to the concat(X, Y, ...) function in SQLite, which is an alternative syntax for the || operator. It joins the string representations of all its arguments. NULL arguments are ignored.

Note: There is also an infix version of CONCAT that can be more readable for two arguments.

Example

// SELECT concat(firstName, ' ', lastName) FROM Users
select(CONCAT(Users.firstName, StringLiteral(" "), Users.lastName)).from(Users).execute()

Return

A new KQLiteColumn of type String representing the concatenated result.

Author

MOHAMMAD AZIM ANSARI

Parameters

columns

The columns or values to concatenate.

See also