An example of my database table
film id | scene id | value id
-----------------------------
0 | 0 | 7
0 | 1 | 1
0 | 1 | 0
1 | 2 | 8
1 | 2 | 3
1 | 3 | 1
2 | 4 | 3
2 | 4 | 7
2 | 5 | 2
I want to select rows where the value id is equal to 8 or 3 only if they are both in a row with the same scene id.
My desired result would be:
film id | scene id | value id
-----------------------------
1 | 2 | 8
1 | 2 | 3
I tried grouping by count of scene id but it would output this:
film id | scene id | value id
-----------------------------
1 | 2 | 8
1 | 2 | 3
2 | 4 | 3
where the last row was included because there were multiple values of scene id.

