I have two tables in MySQL DB; table1, table2.
Both of them have a single column (float) values. It's actually a dump from our research project which produces a single value result.
And many of these values get repeated and sorting and filtering them in Python would be cumbersome, so I though perhaps dumping them in a table in DB would be quicker.
So the end result from the SQL query is the following grouped by the value:
value table1_count table2_count
1.0 0 1
1.1 1 3
2.1 4 5
The query I am coming up with is the following:
select everything.value, everything.count1, everything.count2
from
((
select X as value, count(*) from table1
) union all (
select X as value, count (*) from table2
)) everything
group by everything.value
into outfile "/count";
Any suggestions?
Thanks,