intersect
Appends an INTERSECT operator to the current query, returning only the rows that are present in the result sets of both SELECT statements.
The INTERSECT operator combines the result sets of two SELECT statements and returns the distinct rows that are common to both. This is useful for finding the intersection between two datasets. The SELECT statements being combined must have the same number of columns in their result sets with similar data types.
Example:
SalesTeam
.select(SalesTeam.employeeId)
.intersect {
MarketingTeam.select(MarketingTeam.employeeId)
}.execute(con)This query would find employees who are members of both the Sales and Marketing teams, generating SQL similar to: SELECT employeeId FROM SalesTeam INTERSECT SELECT employeeId FROM MarketingTeam;
Return
A new SelectStatement representing the intersection of the two queries.
Author
MOHAMMAD AZIM ANSARI
Parameters
A lambda function that returns the SelectStatement to be intersected with the current query.
Type Parameters
The type of the KQLiteTable being queried.