I have two tables in MySQL:
Table 1
age code
20 ABC
15 DEF
32 ABC
45 DEF
Table 2
geo code
POLYGON ABC
POLYGON DEF
POLYGON GHI
I counted the double registers with the same "code" on table 1
SELECT
code, COUNT(code) AS cnt FROM table1 GROUP BYcodeHAVING (cnt > 0)
resulted:
code cnt
ABC 2
DEF 2
I want to combine this result with Table 2 and create a third table:
Table 3
geo code cnt
POLYGON ABC 2
POLYGON DEF 2
POLYGON GHI 0
Is that possible?