失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 利用mysql查询每个部门工资最高的两个人 – 数据库 – 前端 mysql 查看是否自动提交数据

利用mysql查询每个部门工资最高的两个人 – 数据库 – 前端 mysql 查看是否自动提交数据

时间:2019-11-01 22:16:30

相关推荐

利用mysql查询每个部门工资最高的两个人 – 数据库 – 前端 mysql 查看是否自动提交数据

下面只定义了基本结构,其他的如索引,字符集等要酌情加上。

create table departments (

id int primary key,

name varchar(50) not null,

parent_id int

)

create table employee (

id int primary key,

department_id int not null,

name varchar(50) not null,

)

下面是一些伪代码

department = select * from departments where name = [department_name]

departments = select * from departments where parent_id = department.id

select * from employee where department_id in [departments.id + department.id]

如果觉得《利用mysql查询每个部门工资最高的两个人 – 数据库 – 前端 mysql 查看是否自动提交数据》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。