Skip to content
Advertisement

INSERT table names using SELECT statement in MySQL

In MySQL, I know I can list the tables in a database with:

JavaScript

But I want to insert a table name into a specified table, for example:

JavaScript

But when I execute the above statement, the dataset_names table does not get updated. I created the master table using:

JavaScript

Here is the python code.

JavaScript

Advertisement

Answer

JavaScript

Here the order on insert values and select values must match;

Advertisement