div

operator fun <T> KQLiteColumn<T>.div(column: KQLiteColumn<out T>): KQLiteColumn<T>

Represents the SQL / (division) operator between two columns.

This operator function allows you to perform division between two KQLiteColumn instances, which translates to column1 / column2 in the generated SQL. This is typically used for numeric calculations, such as calculating ratios or averages.

Example

// SELECT (Metrics.total_sales / Metrics.num_transactions) AS "avg_sale_value" FROM Metrics
Metrics.select(
(Metrics.total_sales / Metrics.num_transactions) AS "avg_sale_value"
)

Return

A new KQLiteColumn representing the result of the division expression.

Author

MOHAMMAD AZIM ANSARI

Parameters

column

The divisor KQLiteColumn (the right-hand side of the division).

See also


operator fun <T> KQLiteColumn<T>.div(literal: T): KQLiteColumn<T>

Represents the SQL / (division) operator between a column and a literal value.

This operator function allows you to divide a KQLiteColumn by a literal value, which translates to column / value in the generated SQL. This is useful for scaling values, converting units, or other numeric calculations.

Example

// SELECT (Salaries.annual_salary / 12) AS "monthly_salary" FROM Salaries
Salaries.select(
(Salaries.annual_salary / 12) AS "monthly_salary"
)

Return

A new KQLiteColumn representing the result of the division expression.

Author

MOHAMMAD AZIM ANSARI

Parameters

literal

The literal value to divide the column by (the divisor).

See also