为成为菜鸟而道歉。。看起来很简单,但现在还停留在这里
table emp
e_id | empname
1 abc
2 xyz
3 PQR
4 def
table sal
s_id | empsal
1 2000
2 1000
3 1000
4 2000
期望的op是具有最高sal的emp名称
abc
def
尝试过
select e.empname from emp e
inner join sal s
on e.e_id = s.s_id
where (s.empsal) in
(select max(empsal) from sal group by id);