Oracle Database - Union

1 - Generator

SELECT 
  statement||DECODE(ROWNUM, MAX(ROWNUM) over (PARTITION BY 1),' order by aantal, table_name;',' union all')
FROM
(
  SELECT 'select '''||table_name||''' table_name, count(1) numberOfRows from '||table_name AS statement
  FROM user_tables
  ORDER BY table_name
);
db/oracle/union.txt ยท Last modified: 2017/09/06 19:29 by gerardnico