Answers for "How to find the number of rows for all views in a schema?"

0

How to find the number of rows for all views in a schema?

select listagg(xx, ' union all ')
from (
    select 'select count(*) c, \''||comment||'\' comment, \'' || x || '\' v from ' || x as xx
    from (
        select TABLE_CATALOG ||'.'|| TABLE_SCHEMA ||'."'||TABLE_NAME||'"' x, comment
        from  KNOEMA_FORECAST_DATA_ATLAS.INFORMATION_SCHEMA.VIEWS
        where table_schema='FORECAST'
    )
)
Posted by: Guest on October-03-2021
0

How to find the number of rows for all views in a schema?

select listagg(xx, ' union all ')
from (
    select 'select count(*) c, \'' || x || '\' v from ' || x as xx
    from (
        select TABLE_CATALOG ||'.'|| TABLE_SCHEMA ||'."'||TABLE_NAME||'"' x
        from  KNOEMA_FORECAST_DATA_ATLAS.INFORMATION_SCHEMA.VIEWS
        where table_schema='FORECAST'
    )
)
Posted by: Guest on October-03-2021

Code answers related to "How to find the number of rows for all views in a schema?"

Browse Popular Code Answers by Language