I have 2 tables like this:
Table1
id | name
------------------
1 | David
2 | Lucas
3 | Antonio
Table2
id | name
------------------
1 | Sergio
2 | Sergio
3 | Lucas
I want to select data to group duplicate records and return this:
name
------------------
David
Lucas
Antonio
Sergio
So I tried with this query
SELECT name FROM Table1 JOIN Table2 GROUP BY name
But nothing is returned.