I have a table `entries` with three columns: `id, name, display_name`.  

I need to write a query with join, which will check how many display\_names there is for each name and display only those names, which have multiple display\_names.  

This should be fairly simple to write with joins. Before I used next query:

```
SELECT e1.name 
FROM entries e1 
WHERE (
  SELECT COUNT(DISTINCT e2.display_name) 
  FROM entries e2 
  WHERE e2.name = r1.name
) > 1;

```