1 Answer
- Newest
- Most votes
- Most comments
0
【以下的回答经过翻译处理】 您可以将此视为两个步骤的过程。
- 动态生成用于获取计数的SQL查询。
- 运行SQL查询的输出以生成计数结果。
with tname_vw(i) as (
SELECT concat(
'select ''',
table_name,
''' as table_name, count(*) from ',
table_name
)
FROM information_schema.tables
WHERE table_schema = 'schema_name'
)
select array_join(array_agg(i), ' union ') as result
from tname_vw
Relevant content
- Accepted Answerasked 10 months ago
- asked a year ago
- asked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 months ago