MySQL query duplicates from 2 columns I need to query duplicates in a table from 2 columns (agents_name) and (estates_name) based off the (display_name) column.

I tried the following: 

SELECT id, display_name, author_table.agents_name, author_table.estates_name, agents_name, estates_name
FROM author_table

INNER JOIN(
SELECT agents_name and estates_name
FROM author_table
GROUP BY agents_name and estates_name
HAVING COUNT(agents_name) &gt;1 and COUNT(estates_name)&gt;1
)temp ON author_table.agents_name and author_table.estates_name = temp.estates_name; 


The last 'sentence' should create a temporary table but I'm getting Error Code: 1054, unknown column temp.estates_name
use aliases for your table especially when you self join

SELECT a1.id, a1.display_name, a1.agents_name, a1.estates_name, t.agents_name, t.estates_name
FROM author_table a1
INNER JOIN(
SELECT agents_name.lestates_name
FROM author_table
GROUP BY agents_name and estates_name
HAVING COUNT(agents_name) &gt;1 AND COUNT(estates_name)&gt;1
)temp t ON a1.agents_name = t.agents_name AND a1.estates_name = t.estates_name;