Hi this is what I need: "Display the name and salary of all employees working on the same Department than 'Mike'. The result shouldn't include 'Mike' "
So I have this query:
SELECT E.Name,E.Salary FROM E WHERE E.DepWorking = (SELECT DepWorking FROM E WHERE Name = 'Mike');
and I get all the employees working in the same department than Mike but it is showing Mike's row too and I don't want that, how can I avoid Mike to show up??
Add an additional condition in the WHERE
clause:
SELECT
E.Name,E.Salary
FROM E
WHERE
E.DepWorking IN (SELECT DepWorking FROM E WHERE Name = 'Mike')
AND E.Name <> 'Mike'
;
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments