在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
#案例:查询员工的工资级别 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; 内容扩展: 语法
案例1:查询员工名,部门名 SELECT last_name,department_name FROM employees e INNER JOIN departments d ON e.department_id=d.department_id; 案例2:查询名字中包含e的员工名和工种名(添加筛选) SELECT last_name,job_title FROM employees e INNER JOIN jobs j ON e.job_id=j.job_id WHERE e.last_name LIKE ‘%e%'; 以上就是本次介绍的全部知识点内容。 |
请发表评论