You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TABLE display_impressions_reach_by_line_test is equivalent to SELECT * FROM display_impressions_reach_by_line_test and once that is understood, you can do this:
dev=> (sql/format {:create-table-as [:temporary:temp_table]
:select:*:from:display_impressions_reach_by_line_test:with-datafalse})
["CREATE TEMPORARY TABLE temp_table AS SELECT * FROM display_impressions_reach_by_line_test WITH NO DATA"]
As a convenience, I'll add a :table clause.
seancorfield
changed the title
Support Temporary Table Creation (PostgreSQL)
Support TABLE clause (for use with CREATE TABLE AS)
Mar 26, 2022
dev=> (sql/format {:create-table-as [:temporary:temp_table]
:table:display_impressions_reach_by_line_test:with-datafalse})
["CREATE TEMPORARY TABLE temp_table AS TABLE display_impressions_reach_by_line_test WITH NO DATA"]
Hi,
From Slack (https://clojurians.slack.com/archives/C66EM8D5H/p1647902883353929). Original author is Nick Stares:
Hello, I'm trying to generate the following (postgres) SQL with honeysql:
I've been playing around with argument orderings to create-table-as but no luck
I can't figure out how I'm supposed to order the symbols in the argument vector.
The text was updated successfully, but these errors were encountered: