Query that returns tables with number of columns, ordered from the ones that have the most.
select tabschema concat '.' concat tabname as table_name, colcount as columns from syscat.tables where type = 'T' order by colcount desc
- table - name of the table (with schema name)
- columns - number of columns in table
- One row represents one table in a database
- Ordered by number of columns descending - from tables with the most columns