Comments - Subquery and EXISTS issue
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
If you're trying to get the first query to return the same result as the second query, this is not how EXISTS works. If the subquery returns any rows at all, then the subquery returns true (and therefore the query is effectively
Select e1.name from employee e1
), otherwise it returns false. See Subqueries and EXISTS.