peewee.ProgrammingError: missing FROM-clause entry for table "t1"
I can't see a problem in the SQL being generated. Can you provide the SQL for a working version and highlight the differences? Also what database are you using? PostgreSQL12

 Can you provide the SQL for a working version? ```
query3 = Bookchapter.select(
    Bookchapter.id,
    Bookchapter.chapter,
)

tt = Books.insert_from(query3, fields=[
    Books.id,
    Books.chapter
]).on_conflict(
    conflict_target=[Books.id],
    update={Books.chapter: Bookchapter.chapter}
).sql()

print(tt)
```

```
<peewee.PostgresqlDatabase object at 0x10d7571c0>
('INSERT INTO "books" ("id", "chapter") SELECT "t1"."id", "t1"."chapter" FROM "bookchapter" AS "t1" ON CONFLICT ("id") DO UPDATE SET "chapter" = "t1"."chapter"', [])
```
 I thought you said it was not working. Please share the sql to a version of the query that works. The proper way to write this is to reference the "new" update-value using `EXCLUDED`. Peewee provides a shortcut, which is the `preserve` option.

```python
Books.insert_from(query3, fields=[
    Books.id,
    Books.chapter
]).on_conflict(
    conflict_target=[Books.id],
    preserve=[q.c.name]  # Note we're referencing the name here.
)
```

You can also write:

```python
.on_conflict(
    conflict_target=[Books.id],
    preserve=['name']  # Name of column to preserve ("carry over") from insert.
)
```
```
query3 = Bookchapter.select(
    Bookchapter.id,
    Bookchapter.chapter,
)

Books.insert_from(query3, fields=[
    Books.id,
    Books.chapter
]).on_conflict(
    conflict_target=[Books.id],
    update={Books.chapter: Bookchapter.chapter}
).execute()
```

