I have a requirement to create or replace a table only if certain variable value is 1
SET variable = (select statement) -- $variable will be 1 or 0 depending on value returned from select statment
create or replace table2 as select * from table1 (only if $variable =1)
Is there any way to do it? If the variable value is 0, the create statement should be skipped