in amazon redshift table i need to select column from table tb2 following conditions:
pg_get_late_data_columns and information schema not working for me
This will need to be some form of dynamic SQL. You should be able to get the info you need in pg_table_def - https://docs.aws.amazon.com/redshift/latest/dg/r_PG_TABLE_DEF.html