0

I use SQLite. How can I use something like this:

INSERT INTO (
    SELECT `table_name`
    FROM `tables`
    WHERE `id`=1)(`data_column_name`)
VALUES ('some data')

Thanks for help

Sven Richter
  • 413
  • 3
  • 8
  • 15

1 Answers1

2

According to the documentation you cannot. The INSERT statement takes a table name - with an optional schema name - not an expression.

You would have to evaluate the SELECT and then build the INSERT statement.

cartant
  • 57,105
  • 17
  • 163
  • 197