Query that returns tables with number of columns, ordered from the ones that have the most.
tabschema concat '.' concat tabname as table_name,
colcount as columns
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