From time to time, I see them being used, but it never seems like itβs impossible to do just as well, if not better, using a regular join or subquery.
I see them as misleading (they may be more difficult to visualize compared to regular joins and subqueries), often misunderstood (for example, using SELECT *
will behave the same as SELECT 1
in the EXISTS/NOT EXISTS
subquery), and from my limited experience, slower to perform.
Can someone describe and / or provide me with an example where they are best suited or where there is no other option but to use them? Please note: since their execution and performance are probably platform dependent, I am particularly interested in their use in MySQL .
sql mysql exists subquery not-exists
Iedsio
source share