Skip to content

Instantly share code, notes, and snippets.

@greeno
Created July 18, 2019 20:56
Show Gist options
  • Save greeno/aa4c069e43317c772a2a902684415c32 to your computer and use it in GitHub Desktop.
Save greeno/aa4c069e43317c772a2a902684415c32 to your computer and use it in GitHub Desktop.
This query returns list of tables in a database with their number of rows.
select tab.table_schema,
tab.table_name,
tinf.tbl_rows as rows
from svv_tables tab
join svv_table_info tinf
on tab.table_schema = tinf.schema
and tab.table_name = tinf.table
where tab.table_type = 'BASE TABLE'
and tab.table_schema in('src_canvas')
and tinf.tbl_rows > 1
order by tinf.tbl_rows desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment