I'm trying to execute an inner join in SQLite3 and it's not working. I keep getting error messages indicating that the field name in table2 is ambiguous.
Would appreciate any input as to why.
SELECT
table1.id, table1.cd1, table1.cd2, table1.cd3, table1.cd4, table2.ab
FROM
table1
INNER JOIN table2 ON table2.dx = table1.cd1
INNER JOIN table2 ON table2.dx = table1.cd2
INNER JOIN table2 ON table2.dx = table1.cd3
INNER JOIN table2 ON table2.dx = table1.cd4
GROUP BY 1, 2, 3, 4, 5, 6
The field "dx" in table2 corresponds to four different fields in table1: "cd1", "cd2", "cd3", "cd4."