本文主要是介绍MySQL-sql99语法-非等值连接,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
非等值连接
查询员工的工资级别
# 非等值连接
# 查询员工的工资级别
select `salary`,`grade_level`
from `job_grades` g
inner join `employees` e
on e.`salary` between g.`lowest_sal` and g.`highest_sal`;
![image](/upload/202205/24/202205240220190505.png)
查询工资级别的个数>2的个数,并且按工资级别降序
# 查询工资级别的个数>2的个数,并且按工资级别降序
select COUNT(*),`grade_level`
from `job_grades` g
inner join `employees` e
on e.`salary` between g.`lowest_sal` and g.`highest_sal`
group by grade_level
having count(*)>20
order by grade_level desc;
![image](/upload/202205/24/202205240220191614.png)
这篇关于MySQL-sql99语法-非等值连接的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!