Skip to content
Advertisement

syntax error at or near “INSERT” when creating a temp table and insert into a subquery–PostgreSQL Error

I created a temp table and insert into a subquery but I got an error saying ‘syntax error at or near “INSERT”‘. Can anyone have idea? Thanks!

Advertisement

Answer

Note that CREATE TABLE and INSERT INTO are two distinct statements. You need to insert a ; between them:

I created a temp table

Note that this is not a temporary table because you are missing the TEMPORARY keyword.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement