内连接 - 等值连接
例子:查询每个员工所在部门名称,显示员工名和部门名
SELECT
e.ename, d.dname
FROM
emp e
INNER JOIN
dept d
ON
e.deptno = d.deptno;
//WHERE ... SQL99 连接条件与筛选分离,连接条件独立,逻辑更清晰
//INNER 可以省略
例子:找出员工薪资等级,要求显示员工名、薪资、薪资等级
SELECT
e.ename, e.sal, s.grade
FROM
emp e
INNER JOIN
salgrade s
ON
e.sal BETWEEN s.losal AND s.hisal;
标签:ename,等值,MySQL9,员工,INNER,薪资,连接
From: https://www.cnblogs.com/Ashen-/p/17032583.html