IN
Creates an IN expression to check if the column's value is present in a given list of values.
This function generates a SQL IN (...) clause, which is an efficient way to test for membership in a set of specified values. It is typically more readable and performs better than multiple OR conditions.
Example
// Find employees in specific departments (e.g., department ID 3, 5, or 7)
// Generates: "department_id" IN (3, 5, 7)
Employees.departmentId.IN(listOf(3, 5, 7))Return
An Expression representing the IN condition.
Author
MOHAMMAD AZIM ANSARI
Parameters
An Iterable collection of values to check against. The function will create a list of placeholders in the final SQL query.
See also
Creates an IN expression to check if the column's value is present in a given list of values.
This function generates a SQL IN (...) clause, which is an efficient way to test for membership in a set of specified values. It is typically more readable and performs better than multiple OR conditions. This overload accepts a variable number of arguments.
Example
// Find employees in specific departments (e.g., department ID 3, 5, or 7)
// Generates: "department_id" IN (3, 5, 7)
Employees.departmentId.IN(3, 5, 7)Return
An Expression representing the IN condition.
Author
MOHAMMAD AZIM ANSARI
Parameters
A vararg array of values to check against. The function will create a list of placeholders in the final SQL query.
See also
Creates an IN expression to check if the column's value is present in the result set of a subquery.
This function generates a SQL IN (SELECT ...) clause, which is used to test for membership in a set of values returned by a SelectStatement. The subquery should select a single column.
Example
// Find all artists who have at least one album in the 'Rock' genre
// Generates: "ArtistId" IN (SELECT "ArtistId" FROM "Album" WHERE "Genre" = 'Rock')
Artists.id.IN(
Album.select(Album.artistId).where { Album.genre EQ "Rock" }
)Return
An Expression representing the IN (subquery) condition.
Author
MOHAMMAD AZIM ANSARI
Parameters
The subquery that provides the set of values to check against. It must return a single column.