Skip to main content

Select

Definition

The select methods allows you to add a SELECT statement to the query.

Available methods

1. select(KQuery kQuery)

  • kQuery: is a subquery which will be added to the INSERT INTO clause.

Method hierarchy

The select method can be used right after the following methods or objects:

and the subsequent methods that can be called are:

Example

Java code:

final KQuery subqueryLanguages = 
k
.select(LANGUAGE.NAME)
.from(LANGUAGE)
.where(LANGUAGE.ID.lt(3));

k
.insertInto(LANGUAGE)
.columns(LANGUAGE.NAME)
.select(subqueryLanguages).execute();

SQL generated:

INSERT INTO language (name)
SELECT la.name
FROM language la
WHERE la.id < ?1

Parameters:

  • ?1: 3