找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索本站精品资源

首页 教程频道 mysql教程 查看内容

mysql内连接怎么写

作者:模板之家 2019-5-29 16:35 375人关注

内连接关键词为INNER JOIN。语句为select * from employees e,department d;where e.employee_id = d.department_id and e.employee_id = 1

连接分为:内连接、外连接、交叉连接。今天我们来学习一下,如何用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内连接怎么写的详细内容,更多请关注模板之家(www.mb5.com.cn)其它相关文章!


路过

雷人

握手

鲜花

鸡蛋
来自: [db:来源]

全部回复(0)

发表评论