Archives of the TeradataForum
Message Posted: Thu, 09 May 2002 @ 14:08:11 GMT
Your souutions don't achieve what I am looking for.
Your solution will always give the count as 1 as you are grouping by dbc.tablename and each table name is unique. What I want is to see the table name and the count of rows in each table at a glance.
select (trim (databasename)||'.'||trim(tablename)) as tablename , count(*) from dbc.tables group by 1 order by 1
This only gives the counts of columns in a table (from dbc.columns)and not the number of rows in a table.
select (trim (t.databasename)||'.'||trim(t.tablename)) as tablename, count(*) from dbc.tables t join dbc.columns c on (t.databasename = c.databasename and t.tablename = c.tablename) group by 1 order by 1
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|