I have a list of tables for example:
mytableA
mytableB
mytableC
The tables all have same column (timestamp).
I can do a count on each table individually:
select count(*) from mytableA where timestamp = to_char(sysdate-1, 'yyyymmdd') || '0000';
select count(*) from mytableB where timestamp = to_char(sysdate-1, 'yyyymmdd') || '0000';
select count(*) from mytableC where timestamp = to_char(sysdate-1, 'yyyymmdd') || '0000';
How can I combine this in one single query? Is there an easy way?
Expected Results:
MyTableName MyCnt
----------- -----
mytableA 121
mytableB 78
mytableC 2345