Answer the question
In order to leave comments, you need to log in
SQL. How to get one from two given queries?
Request #1:
select s.salary from salaries as s
join employees as e on e.emp_no = s.emp_no
where s.to_date = '9999-01-01' and e.gender = 'F'
order by salary desc limit 1
select s.salary from salaries as s
join employees as e on e.emp_no = s.emp_no
where s.to_date = '9999-01-01' and e.gender = 'M'
order by salary desc limit 1
Answer the question
In order to leave comments, you need to log in
select MAX(s.salary) from salaries as s
join employees as e on e.emp_no = s.emp_no
where s.to_date = '9999-01-01'
GROUP BY e.gender
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question