select t.TABNAME as 表名 , count(*) as 总数目 FROM (select TABNAME from syscat.tables where tabschema='ts' ) as t group by t.tabname
这条语句执行的结果,总数目怎么都是1?
要得到表的总数?
select count(*) as 总数目 FROM (select TABNAME from syscat.tables where tabschema='ts' ) as t
syscat.tables里,每个表都只有一行
select count(*) as 总数目 from syscat.tables where tabschema='ts'
这个要用SP,取得所有表名->打开游标->取得表名->执行COUNT(*)得到结果,插入1个表中->SELECT此表论文网http://www.751com.cn/
oracle 的组合查询一条语句就搞定,我也是那样写的
oracle 什么版本?也是这样的语句?
select t.TABNAME as 表名 , count(*) as 总数目 FROM (select TABNAME from syscat.tables where tabschema='ts' ) as t group by t.tabname