from this table..
Question: List the employees who report to those employees who report to Diane Murphy. Use the CONCAT function to combine the employee's first name and last name into a single field for reporting.
My non-working query..
SELECT employeeNumber, CONCAT(firstName, ' ', lastName), reportsTo
WHERE reportsto= 1002
AND WHERE (SELECT CONCAT(firstName, ' ', lastName), reportsTo
WHERE reportsTo= 1056 AND 1076);
This should do what you want:
select e1.employeeNumber, CONCAT(e1.firstName, ' ', e1.lastName), e1.reportsTo from Employees as e1 inner join Employees as e2 on e1.reportsTo = e2.employeeNumber where e2.reportsTo = 1002