I have two or more tables different by structure and I want to compare their numbers of rows, which I get with the count-star query:
select count(*) from table_a
For two tables I would like to see the difference of the count-star-queries, for example. If this difference is 0, then the tables have the same number of rows.
For more tables you can calculate an average of the count-star queries (or something more meaningful than the average, up to you) and compare the single count-star's with this value. The main point is that, if all the N tables have the same size, I have as result N columns (or rows) filled with 0's. If the tables have not the same number of rows, then in each of the N columns (or rows) I expect to see the difference of the number of rows of a given table and the average (or something more meaningful, cf. above).
I have this problem on an Oracle DB but I could need this query on PostgreSQL in the future, probably we will migrate.
The most efficient the query is, the coolest, of course. Please comment on this also if you want.