本文介绍了如何获得员工详细信息,按国家/地区分列薪水的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
SELECT country,max(WS) FROM AVI_ICAOCodeList GROUP BY country
>
country | salary | name | adress
-------------------------------------
India | 10000 | ch1 | something
----------------------------------------
japan | 20000 | ch2 |nothing
-----------------------------------
india | 25000 | ch3 | hjsdj
-----------------------------------
japan | 30000 | ch4 |hjhjhj
我需要获得最高薪水在日本和印度都有地址,名字
我尝试过:
SELECT country,max(WS)FROM AVI_ICAOCodeList GROUP BY country
in this i need to get max salary in japan and also in india with adress, name
What I have tried:
SELECT country,max(WS) FROM AVI_ICAOCodeList GROUP BY country
推荐答案
select t0.* from AVI_ICAOCodeList t0
inner join(
select country , max(salary) as salary from AVI_ICAOCodeList group by country
) t1 on t0.country = t1.country and t0.salary = t1.salary
这篇关于如何获得员工详细信息,按国家/地区分列薪水的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!