You can easily extract a set of columns without the primary key as follows:
List> fields = new ArrayList<>(Arrays.asList(KTO.fields()));
fields.removeAll(KTO.getPrimaryKey().getFields());
create1.insertInto(KTO).columns(fields).select(
select(fields).from(KTO)
I try to copy the records from one database to another.
create1.insertInto(Tables.KTO).select(
create2.select().from(Tables.KTO)
).execute();
Since I have a primary key with auto_increment this wont work.
In pure SQL it is not possible to exclude the primary key