myMySQL数据库内连接怎么写 MySQL数据库使用教程

凤凰 2021-1-19 87 1/19

连接分为:内连接、外连接、交叉连接。今天我们来学习一下,如何用MySQL建立内连接。

myMySQL数据库内连接怎么写 MySQL数据库使用教程

内连接定义:仅将两个表中满足连接条件的行组合起来作为结果集。

关键词:INNER JOIN

select * from employees e inner join department d 
on e.employee_id = d.department_id  where e.employee_id = "1";

等价于

select * from employees e,department d 
where e.employee_id = d.department_id and e.employee_id = "1";

以上就是mysql内连接怎么写的详细内容,更多请关注本站其它相关文章!

- THE END -

凤凰

1月19日09:12

最后修改:2021年1月19日
0

非特殊说明,本博所有文章均为博主原创。