Du bør bruge underforespørgsler på int og ext til at summere og slutte sig til underforespørgslerne.
Jeg foreslår også at bruge eksplicitte JOINs i stedet for tabel, tabel, tabel
f.eks.
SELECT emp.Name, int.Amount AS InternalCostTotal, ext.Amount AS ExternalCostTotal
FROM Employees emp
JOIN (
SELECT EmployeeID, SUM(Amount) AS Amount
FROM InternalCosts
GROUP BY EmployeeID
) int ON emp.EmployeeId = int.EmployeeID
JOIN (
SELECT EmployeeID, SUM(Amount) AS Amount
FROM ExternalCosts
GROUP BY EmployeeID
) ext ON emp.EmployeeId = ext.EmployeeID