Guest User

Untitled

a guest
Dec 11th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. key1 key2 key 3
  2. v1 d1 t1
  3. v2 d2 t1
  4. v3 d1 t4
  5. v1 d3 t8
  6. v1 d2 t4
  7.  
  8. key1 v1 3
  9. key1 v2 1
  10. key1 v3 1
  11. key2 d1 2
  12.  
  13. (select 'key1' AS column_origin, key1, count(key1) from TestTable group by key1)
  14. union all
  15. (select 'key2', key2, count(key2) from TestTable group by key2)
  16. union all
  17. (select 'key3', key3, count(key3) from TestTable group by key3);
Add Comment
Please, Sign In to add comment