Re: struggling with a subquery
> SELECT risk, SUM(w2_wages) as total_wages FROM employees
> WHERE (SELECT risk FROM titles WHERE employee_title=title GROUP BY risk
Is this what you mean?
SELECT t.risk, SUM(e.w2_wages) as total_wages
FROM employees e
JOIN titles t ON e.employee_title=t.title
GROUP BY risk;
Edited 1 time(s). Last edit at 08/30/2020 12:58PM by Peter Brawley.
Subject
Written By
Posted
Re: struggling with a subquery
August 30, 2020 09:17AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.