daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Aug 19th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top