id | apples | oranges
1 111 p
2 112 p
3 113 p
4 113 f
5 113 -
6 114 p
7 114 f
8 115 -
9 115 -
10 116 f
Looking for a way to return only the rows where:
- oranges contains value 'f' or no value (empty)
- there are duplicate values in apples
- at least one duplicate in applies contains value of 'p' in oranges.
The rows 4,5 & 7 in bold and italic are what I am after.