with cols as (select column_name, 'o.' || column_name as alias, 'AFG.' || table_schema || '.' || table_name as tbl_spec
from afg.information_schema.columns
where table_schema = 'RAW_FLEX_SIEBEL' and table_name = 'S_OPTY'
and column_name not in...
with cols as (select column_name, 'c.' || column_name as alias, 'AFG.' || table_schema || '.' || table_name as tbl_spec
from afg.information_schema.columns
where table_schema = 'RAW_FLEX_SIEBEL' and table_name = 'S_CONTACT'
and column_name not...
Snowflake cloud data warehouse supports the DECODE function which is similar to other relational databases such as Redhift, Netezza, Oracle, SQL Server, etc. The DECODE function is used to implement simple case statements. i.e. you can use it to implement simple if-then-else...