groupConcat

fun <T : String?> Expression<T>.groupConcat(separator: String? = null, distinct: Boolean = false, orderBy: Pair<Expression<*>, SortOrder>): GroupConcat<T>
fun <T : String?> Expression<T>.groupConcat(separator: String? = null, distinct: Boolean = false, orderBy: Array<Pair<Expression<*>, SortOrder>> = emptyArray()): GroupConcat<T>

Concatenates all non-null input values of each group from this string expression, separated by separator.

Parameters

separator

The separator to use between concatenated values. If left null, the database default will be used. It is bound as a query parameter, except on SQL Server and Redshift, where it is written into the statement as a string literal with its single quotes escaped. Either way it is treated as data, so it must be passed as is, without being escaped on the client side.

distinct

If set to true, duplicate values will be eliminated.

orderBy

If specified, values will be sorted in the concatenated string.

Samples

org.jetbrains.exposed.v1.tests.shared.dml.GroupByTests.testGroupConcat