SQL怎么查询两个表中不同的数据?

日期:2019-06-17 23:01:38 人气:1

SQL怎么查询两个表中不同的数据?

我们需要准备的材料分别是:电脑、sql查询器。 1、首先,打开sql查询器,连接上相应的数据库表,以查询c1表和c2表的name字段不同为例。 2、点击“查询”按钮,输入: select c1.`name` from c1 left join c2 on c1.`name`=c2.`name` where c2.`name` is null union select c2.`name` from c2 left join c1 on c1.`name`=c2.`name` where c1.`name`
    A+
热门评论