LMSouq
database Open

Get table names using SELECT statement in MySQL

MI
Mike Chamberlain
1 month ago
3 views
Problem Description
In MySQL, I know I can list the tables in a database with: SHOW TABLES However, I want to insert these table names into another table, for instance: INSERT INTO metadata(table_name) SHOW TABLES /* does not work */ Is there a way to get the table names using a standard SELECT statement, something like: INSERT INTO metadata(table_name) SELECT name FROM table_names /* what should table_names be? */

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base