I'm trying to get the count from two different tables and group them together. The problem I am running into is that I either get really long query times 30 mins + or it just doesn't display the way I want it to.
I got the code for this part to semi work and running fast using a union. (Which is most likely wrong, but all my attempts at trying with a join have made the run times incredibly long)
select `model`, count(*) as "Test1"
from `table1`
group by `model`
union
select `model`, count(*) as "Test2"
from `table2`
group by `model`
This is getting to show the counts on a huge scrolling list, where the first count is being displayed then the other. Also while only displaying the "Test1" text, the "Test2" wont display.
I would like to have it so that they display next to each other so that I can see how many of one model I have compared to the other tables model.
Any help would be appreciated, sorry for any confusion first time posting here
EDIT: Tried my best to give a small sample of what I'm seeing with the union code
Model |Test1
Suzuki| 2
Honda | 19
Suzuki| 5
Honda | 26
so something like that would show up, where the first 2 results would be from the first select statement and the other 2 would be from the second select statement.
The result I'm looking for is more like this.
Model | Test1 Model | Test2
Suzuki| 2 Suzuki| 5
Honda | 19 Honda | 26