📅  最后修改于: 2022-03-11 15:00:34.148000             🧑  作者: Mango
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'
)
)