Guest User

Untitled

a guest
Aug 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. Count several tables and return data in multiple rows in SQL
  2. | tablename | row_count |
  3. | Computers | 2000 |
  4. | Buildings | 37 |
  5.  
  6. select 'Computers' as tablename, count(*) as row_count from Computers
  7. union all
  8. select 'Buildings' as tablename, count(*) as row_count from Buildings
Add Comment
Please, Sign In to add comment