I have 3 tables
Table1 has id cell
Table2 has id cell
Table3 has id1 cell -> corresponds to Table1.id
Table3 has id2 cell -> corresponds to Table2.id
I need a result that count how many times the pair of id1 and id2 appeared in Table3, also for a result that did not appear.
So cant use simple Select * from table3 group by id1, id2.
I used
SELECT *
FROM table1, table2,
(SELECT COUNT(*) AS count
FROM table3
GROUP BY id1, id2)
GROUP BY table1.id, table2.id
but it is slow as molasses and it does not work.