I'm trying to join two MySQL tables, and return only the unique values between them. eg.
Table1
column1|column2
-------------
c1value1|c2value1-1
c1value2|c2value1-2
c1value3|c2value1-3
Table2
column1|column2
-------------
c1value1|c2value1-1
c1value1|c2value2-1
c1value1|c2value3-1
c1value2|c2value1-2
c1value3|c2value1-3
I want to get as my result a table that only shows the intersections of rows without any duplicates where I'm joining on table1.column1 = table2.column1:
Joined Table
table1.column2|table2.column2
-----------------------------
table1.c2value1-2|c2value1-2
table1.c2value1-3|c2value1-3
Simple joins and unions and I'm ok, but this one is causing me a headache.
Edit for clarification: I don't want any results in my joined table where Table 2 has > 1 entry in column 1. I only want to get back the values from column2 for c1value2 and c1value3.
My first thought was to get the distinct count of column2 GROUP BY column1 WHERE distinct count = 1 but that's error city.
table1.c2value1-2
is not present in Table1, but it is in your Joined Table) – Eric Ávila