1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > MySQL联合查询(多表查询)

MySQL联合查询(多表查询)

时间:2022-01-03 01:33:20

相关推荐

MySQL联合查询(多表查询)

一、内连接

select *from 表1 [ inner | cross ] join 表2 [ on过滤条件 ] [ where查询条件 ] ;

[ inner | cross ]:

join 内连接关键字(必须要有);

on从语法上可省略,但如果省略它,将查询的是多表的笛卡尔积;

1.select *from 表1 join 表2 [ on过滤条件 ] [ where查询条件 ] ;

2.select *from 表1,表2 [ where查询条件 ] ;

3.select *from 表1 inner join 表2 [ on过滤条件 ] [ where查询条件 ] ;

4.select *from 表1 cross join 表2 [ on过滤条件 ] [ where查询条件 ] ;

(1.2使用较多;多表查询使用1较好)

例1

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。