mysql sql99语法 内连接非等值连接

#案例:查询员工的工资级别

SELECT
    salary,grade_level
FROM
    employees e
JOIN
    job_grades g
ON
    e.`salary` BETWEEN g.`lowest_sal` AND g.`lowest_sal`;

#案例:查询每个工资级别的个数,并且按级别降序

SELECT
    COUNT(*),grade_level
FROM
    job_grades j
JOIN
    employees e
ON
    e.`salary` BETWEEN j.`lowest_sal`AND j.`highest_sal`
GROUP BY
    grade_level DESC;
    原文作者:wx5d21d5e6e5ab1
    原文地址: https://blog.51cto.com/14437184/2437910
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞