How can I create a table from an existing table in SQL but using cells from the old table as columns in the new table?
I tried this once, but due to some database settings I was not permitted to create a table with an SQL-command. Maybe something similar is happening to you? I had to copy the DDL code (Data Definition Language) for the table and create it, and then add the rows.
Maybe you could first copy and run the DDL. Should be available in whatever program you are using for the database.
https://www.educba.com/sql-ddl-commands/
Once the table is created, it will be empty. Then you populate it. Here is some example code.
INSERT INTO table2 (column1, column2, column3, ...)
SELECT column1, column2, column3, ...
FROM table1
WHERE condition1 AND condition2 AND condition3;