Ezzy Pzzy ✌️ 🤞|| Oracle Solution || BEGINNER FRIENDLY ||Complete Explanation|| Group by with count
Intuition\nAs the problem requires pair of two column and its count. Therefore,my first thought is to use Group by. \n\n# Approach\nTo use group by on two colum
# Intuition\nAs the problem requires pair of two column and its count. Therefore,my first thought is to use Group by. \n\n# Approach\nTo use group by on two columns with count we can use:\ngroup by(col1, col2) having count(1)>2\nThis will first collect all the pairs of actors and directors and then count their frequency and return the rows where the frequency is greater then 2 or atleast 3\n\n\n# Code\n```\n/* Write your PL/SQL query statement below */\n\nselect actor_id, director_id from ActorDirector group by actor_id, director_id having count(1)>2;\n\n\n\n```\n![upvote.webp](https://assets.leetcode.com/users/images/e82af2e4-81a3-47ce-8159-65f821e3185d_1694084265.033327.webp)\n\n
['Oracle']