Redshift: Executing a dynamic query from a string
问题 I would like to execute a dynamic SQL query stored in a string field on Amazon Redshift. My background is mostly T-SQL relational databases. I used to build SQL statements dynamically, store them into variables and them execute them. I know Redshift can prepare and execute statements, but I wonder if it is possible to execute a query stored in a string field. I have a piece of code that dynamically builds the code below with stats on several tables using pg_* system tables. Every column/table