多表查询-实验

表连接实验

1 基础表

1.1tb2 

1.2 tb3 

 

2 连接实验 

2.1 自然连接

 

2.2 using 子句

2.2.1  using(name)

 

2.2.1  using(id) 

 

2.3 on子句

2.3.1 外连接

2.3.1.1 左连接 

 

2.3.1.2 右连接  

 

2.3.2 内连接

 

2.4 数据集合运算

2.4.1 共集

2.4.1.1 union

2.4.1.2 union all 

2.4.2 差集

select * from tb3 minus select * from tb3 where id>10

2.4.3 交集 

select * from tb3 intersect select * from tb3 where id>10

发布了463 篇原创文章 · 获赞 38 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/xie__jin__cheng/article/details/102975296