本文共 523 字,大约阅读时间需要 1 分钟。
1.1.1 多表查询的分类
1.1.1.1 连接查询l 交叉连接:cross joinn 交叉连接:查询到的是两个表的笛卡尔积。n 语法:u select from 表1 cross join 表2;u select from 表1,表2;l 内连接:inner join(inner是可以省略的)n 显示内连接:在SQL中显示的调用inner join关键字u 语法:select from 表1 inner join 表2 on 关联条件;n 隐式内连接:在SQL中没有调用inner join关键字u 语法:select from 表1,表2 where 关联条件;l 外连接:outer join(outer可以省略的)n 左外连接:u 语法:select from 表1 left outer join 表2 on 关联条件;n 右外连接u 语法:select from 表1 right outer join 表2 on 关联条件;1.1.1.2 子查询l 子查询:一个查询语句条件需要依赖另一个查询语句的结果。转载于:https://blog.51cto.com/13587708/2111991