连接分为:内连接、外连接、交叉连接。今天我们来学习一下,如何用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"; (责任编辑:yang) |