How to select people like apple and banana both from the data below?
table: MyTable
persons | fruit
-----------------------------
P1 Apple
P1 Banana
P1 Mango
P2 Banana
P2 Apple
P3 Mango
P3 Apple
i.e in this case, P1, P2 should be the result.
I tried with
select * from MyTable where fruit in("Apple","Banana");
This is also resulting P3 because P3 also have apple.
Thanks for any help.