English | 简体中文

api-docs / org.ktorm.support.mysql / IF

IF

fun <T : Any> IF(
    condition: ColumnDeclaring<Boolean>,
    then: ColumnDeclaring<T>,
    otherwise: ColumnDeclaring<T>
): FunctionExpression<T>
(source code)

inline fun <reified T : Any> IF(
    condition: ColumnDeclaring<Boolean>,
    then: T,
    otherwise: T,
    sqlType: SqlType<T> = sqlTypeOf() ?: error("Cannot detect the param's SqlType, please specify manually.")
): FunctionExpression<T>
(source code)

MySQL if function, translated to if(condition, then, otherwise).

Since
3.1.0