3 ms·
You don't have to do all of those things though? Just create table as select (or sometimes select into).
by saurik 5y ago
You don't have to do all of those things though? Just create table as select (or sometimes select into).
- cm2187 5y agoThanks. I didn't know this syntax. You still have to drop it in the end but somehow I never ran into this syntax.
- croes 5y agoYou don't have to drop temp tables unless you want to use a second select into in the same session. Otherwise temp tables are automatically dropped if the session ends.
- zbuf 5y agoEven better, look at WITH, or CREATE TEMPORARY VIEW AS. Then the planner can make optimisations to the overall query. That is assuming you use your "temporary" only once.
- deleted 5y ago[deleted]