I have the 4 following identical selects that return the same column outputs with different results.

something like :

1) `select a, count(*) from table a;`

2) `select a, count(*) from table b;`

3) `select a, count(*) from table c;`

4) `select a, count(*) from table d;`

they all output something like :

```
=================
a     |count(*) (Table a)| 
=================
hi    | 2
hello | 3    
why   | 4

=================
a     |count(*) (Table b)| 
=================
hi    | 4
hello | 6
why   | 8

```

Similarly for table c and d . 

I wanted to do a join on all 4 of these tables so that I can get a single table where the same columns are summed and grouped and shown as one, Something like this

```
=================
a     |count(*) (Table a & b union )| 
=================
hi    | 6
hello | 9
why   | 12

```

I have worked out a query that works well for two tables but further unions on table don't work out well : 

`select a, sum(total) from (select a, count(*) from table a union all select a, count(*) from table b) as T group by a;`

This works well for two tables but not more than that what am I missing.