'How to remove rows with different values within the same option value

In SQL, can someone help me understand what the query may look like if I'm trying to remove the red-highlighted rows from the image? Based on the logic I need, I need to remove records with different priority values within an option, where as the ones we want to keep have the same priority. Each item/cntry combination has it's own option values (typically 4 like you see here).

I feel like this is just a join to itself, but my mind is mush right now. Help would be appreciated!

enter image description here



Solution 1:[1]

use exists and distinct count()

select t1.* from table_name t1 where
exists ( 
select 1
from table_name t2
where t1.option=t2.option
group by option
having count (distinct priority)=1
)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zaynul Abadin Tuhin