本文介绍了显示在表2中但不在表1中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个mysql问题.例如,假设我有两个具有以下值的表:

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

  • 表1:apple, orange, banana, kiwi, jackfruit, mango, strawberry
  • 表2:apple, orange, banana, jackfruit.
  • 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)

这篇关于显示在表2中但不在表1中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 22:33