我有一张桌子"员工":
E_ID E_Name E_Salary Grade
01 Hansen, Ola 15,000 HC_1
02 Svendson, Tove 15,000 HC_2
03 Svendson, Stephen 32,000 HC_9
04 Pettersen, Kari 21,000 HC_1
05 Sachin, Tendulkar 21,000 HC_2
06 Brian, Lara 19,000 HC_3
我需要返回同时具有HC_1和HC_2等级的员工薪水。有人可以帮我构建查询。
感谢您的时间。
答案 0 :(得分:2)
我想你想......
Select e_salary
from employees
where grade in ('HC_1','HC_2')
group by e_salary
having count(distinct grade) = 2