Please, read this:
Visual Representation of SQL Joins[
^] and i promise you, you'll find an answer ;)
Tip: To get result by using single
select
statement, you need to use
HAVING clause[
^].
SELECT E.EmployeeName, SUM(S.employeesalary) as Salary
FROM EmployeeDetails AS E RIGHT JOIN EmployeeSalary AS S on E.Id= S.Id
GROUP BY E.EmployeeName
HAVING SUM(S.employeesalary)>1000