I am trying to create a temporary table and add information from another table into it. However I keep getting the error
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'SELECT course_name, ins_name FROM courses where
course_name='ACCA'' at line 2'
INSERT INTO #TempTable (course, ins)
SELECT course_name, ins_name
where course_name = 'ACCA'
You should create the temp table first
CREATE TEMPORARY TABLE IF NOT EXISTS your_table AS (SELECT course_name, ins_name FROM courses where course_name='ACCA');