【发布时间】:2013-12-24 16:23:26
【问题描述】:
我正在从一个提供表列表的表中进行查询(根据不同的条件列表会有所不同)。
我想显示表名列表及其行数。我怎样才能做到这一点?
我试过了
select count(*) from (select tablename from main_table) as t;
但它只返回 main_table 中的条目数,而不是每个表中的条目数。
我可以使用系统表来获取行数,但我不想要所有表,只需要特定表,并且可能需要特定查询的行数。
算法是这样的
for tablenames in main_table where id>3:
select count(*) from tablename where constraints
【问题讨论】: