Where
Definition
The where methods allows you to add the WHERE clause to the query.
Available methods
1. where(KCondition kCondition)
- kCondition: which contains all the information about the condition that will be added to the
WHEREclause.
2. where(KRaw kRaw)
- kRaw: is a raw content which will be added in the
WHEREclause.
Method hierarchy
The where method can be used right after the following methods:
and the subsequent methods that can be called are:
and,andNot,or,orNot,groupBy,window,except,exceptAll,intersect,intersectAll,union,unionAll,orderBy,limit,offset,fetch,single,multiple
Example: KCondition
Java code:
k
.selectDistinct(APP_USER.ID)
.from(APP_USER)
.where(APP_USER.EMAIL.isNull())
.multiple();
SQL generated:
SELECT DISTINCT au.id
FROM app_user au
WHERE au.email IS NULL
Parameters:
- None
Example: KRaw
Java code:
k
.select(APP_USER.ID)
.from(APP_USER)
.where(raw("au.created_at > CURRENT_DATE - 1"))
.multiple();
SQL generated:
SELECT DISTINCT au.id
FROM app_user au
WHERE au.created_at > CURRENT_DATE - 1
Parameters:
- None