显示Table2中的值,但不显示Table1中的值

I have a mysql problem. Let's say for example I have two tables with the following values:

  • Table1: apple, orange, banana, kiwi, jackfruit, mango, strawberry
  • Table2: apple, orange, banana, jackfruit.

My question is how can I make a query that will only choose/display the values:

 kiwi, mango, strawberry

Can anyone provide a sample code for this?

select column from table1 where column not in (select column from table2)

Option #1

SELECT table1.fruit FROM table1
LEFT JOIN table2
    ON table1.fruit = table2.fruit
WHERE table2.fruit IS NULL

Option #2

SELECT table1.fruit FROM table1
WHERE NOT EXISTS (
    SELECT 1 FROM table2
    WHERE table2.fruit = table1.fruit
)

I'd have to see the explain plans to recall which is more efficient but it really depends on any indexes you have created.