MySQL solution using [HAVING] | Easy Step-by-Step Explanation
\n# Write your MySQL query statement below\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(director_id)>=3;\n\n\
```\n# Write your MySQL query statement below\nSELECT actor_id, director_id\nFROM ActorDirector\nGROUP BY actor_id, director_id\nHAVING COUNT(director_id)>=3;\n```\n\n**Explanation:**\n```\nSELECT actor_id, director_id\nFROM ActorDirector\n```\n* First I have selected **actor_id and director_id**.\n\n```\nGROUP BY actor_id, director_id\n```\n* Then I have **GROUP BY** them by **actor_id and director_id** as we need both to fulfill the condition.\n\n```\nHAVING COUNT(director_id)>=3;\n```\n* I have used **HAVING** clause on **COUNT** of **director_id**.\n* If it is greater than equal to 3 than filter out the result.\n* You can also use **actor_id**.
['MySQL']