IBM DB2 Query Toolbox - List tables with the largest number of columns



Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

IBM Db2 Query Toolbox - List tables with the largest number of columns in Db2 database

Consulta que retorna tabelas com número de colunas, ordenadas a partir das que possuem mais.
Query that returns tables with number of columns, ordered from the ones that have the most.

Consulta - Query

SELECT TABSCHEMA CONCAT '.' CONCAT TABNAME AS TABLE_NAME
,      COLCOUNT AS COLUMNS
  FROM SYSCAT.TABLES
 WHERE TYPE = 'T'
 ORDER BY COLCOUNT DESC

Colunas

  • tabela - nome da tabela (com nome do esquema)
  • colunas - número de colunas na tabela

Linhas

  • Uma linha representa uma tabela em um banco de dados
  • Ordenado pelo número de colunas decrescentes - das tabelas com mais colunas

Columns

  • table - name of the table (with schema name)
  • columns - number of columns in table

Rows

  • One row represents one table in a database
  • Ordered by number of columns descending - from tables with the most columns

Resultado - Sample results


Copyright © Dataedo.