I'm trying to construct a sql statement to check 2 tables. Here's what I am trying to do.
tableA - is a list of fruits
(fruits)
apples
bananas
pears
grapes
orange
table B - is a list of fruit combinations
(fruit_1) (fruit_2)
apple banana
orange banana
apple pear
I want to get a list of fruits that I have not combined with an apple before. Here's what I have, but can't get the result I want.
SELECT tableA.fruits FROM tableA, tableB WHERE tableA.fruits != apples AND tableB.fruit1 != apples AND tableB.fruit2 != apples;
What I want is
orange
grapes