select table_name,column_name from INFORMATION_SCHEMA.COLUMNS where DATA_TYPE = 'varchar'
Output
table_name column_name
t1 c1
t1 c2
t1 c3
t2 col1
t2 col2
t3 column1
Expected Output
I want to generate below listed select statement as output by querying INFORMATION_SCHEMA.COLUMNS table.
select c1,c2,c3 from t1
select col1,col2 from t2
select column1 from t3
With Regards, Khokhar Murtuja S Database Administrator