相同的 select 表1.姓名,表1.性别,表1.年龄 from 表1,表2 where 表1.姓名=表2.姓名 and 表1.性别=表2.性别 and 表1.年龄=表2.年龄 不同的 select 表1.姓名,表1.性别,表1.年龄 from 表1 union select 表2.姓名,表2.性别,表2.年龄 from 表2 minus select 表1.姓名,表1.性别,表1.年龄 from 表1,表2 where 表1.姓名=表2.姓名 and 表1.性别=表2.性别 and 表1.年龄=表2.年龄
select 表1.姓名,表1.性别,表1.年龄 from 表1 join 表2 on 表1.姓名 = 表2.姓名 and 表1.年龄= 表2.年龄
intersect: 取重复的记录(相当于交集吧)select * from 表1 intersect select * from 表2
select 表1.姓名,表1.性别,表1.年龄 from 表1,表2
where 表1.姓名=表2.姓名 and 表1.性别=表2.性别 and 表1.年龄=表2.年龄
不同的
select 表1.姓名,表1.性别,表1.年龄 from 表1
union
select 表2.姓名,表2.性别,表2.年龄 from 表2
minus
select 表1.姓名,表1.性别,表1.年龄 from 表1,表2
where 表1.姓名=表2.姓名 and 表1.性别=表2.性别 and 表1.年龄=表2.年龄
intersect
select * from 表2