Skip to content
Advertisement

How to create empty temporary table?

Need to create empty temporary table, but that not depends any query result yet, but I need only structure. (then, according to some logic, will be different data inserted into this).

throws syntax error

So is this way (which looks bit “tricky”) only correct way:

?

Advertisement

Answer

As documented in the manual the ON COMMIT option needs to be after the table definition:

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