mysql面试题

1.表act_employee

 

 

 

2.表act_part

 

 

 3.求:展示以下结果

 

 

 

SQL语句编写:

SELECT
    a.`name`,
    a.salary,
    b.`name` 
FROM
    act_employee a,
    act_part b 
WHERE
    a.part_id = b.id 
    AND a.salary IN ( SELECT max( salary ) FROM act_employee GROUP BY part_id HAVING a.part_id = part_id )

 

 

 

posted @ 2019-11-13 20:12  Cool_Yang  阅读(79)  评论(0编辑  收藏  举报