Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Count several tables and return data in multiple rows in SQL
- | tablename | row_count |
- | Computers | 2000 |
- | Buildings | 37 |
- select 'Computers' as tablename, count(*) as row_count from Computers
- union all
- select 'Buildings' as tablename, count(*) as row_count from Buildings
Add Comment
Please, Sign In to add comment