Good Evening We have multiple tables in multiple schemas in DB. we are tyring to find out maximum size of each column in the table for all tables and for all schemas.
Example column names: a,b,c,d,e,f,g Example schema names: A,B,C,D
Expected output: column_name Max_size_of_column
or column_name Max_size_of_column column_table table_schema
I have tried the below query, but not able to get the desired output.
SELECT (select column_name from INFORMATION_SCHEMA.COLUMNS
where table_name='building'),
select max(length(select column_name from INFORMATION_SCHEMA.COLUMNS
where table_name='building')) from from INFORMATION_SCHEMA.COLUMNS
where table_name='building'
group by column_name;
Please help us to get the desired output. Thanks