I need to compose a dynamic SQL statement, which includes certain functions on column names.
E.g.: SELECT json_col::text, SUBSTRING ( string_col ,1 , 2 ) FROM TABLE
Since the column names are enclosed in "", I keep getting undefined column error. What is the best way to compose a dynamic SQL with functions on column names?