SELECT * FROM employees e WHERE NOT EXISTS ( SELECT name FROM eotm_dyn d WHERE d.employeeID = e.id )
AND
SELECT * FROM employees a LEFT JOIN eotm_dyn b on (a.joinfield=b.joinfield) WHERE b.name IS NULL
Which is more efficient, some analysis?
Assuming column values cannot be NULL -
LEFT JOIN/IS NULL more effective than NOT EXISTS- read this article for more details .
LEFT JOIN/IS NULL
NOT EXISTS
They are equivalent .
NOT EXISTS more effective than LEFT JOIN/IS NULL- read this article in more detail .
Like Oracle, they are equivalent .
, , LEFT JOIN/IS NULL - , LEFT JOIN. .
, . , .
! , , . employee eotm_dyn, IMO WHERE NOT EXISTS. , , , SELECT 1 (not SELECT name), name " eotm_dyn.
employee
eotm_dyn
WHERE NOT EXISTS
SELECT 1
SELECT name
name
, , , , .
Source: https://habr.com/ru/post/1738002/More articles:Is a CSS block attribute affecting the correctness of HTML? - htmlA good way to keep PHPBB3 boards safe from hackers? - securityУлучшение производительности приложений - performanceHow can I make an SQL expression that finds unrelated records? - sqlHow does the garbage collector determine if an object is garbage? - garbage-collectionEclipse IDE Learning Curve - eclipseпроблема с соединением - c#Successful tracking of OSCommerce tracking results - phpThe structure of the database. Join or not join. - mysqlhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1738007/mongodb-in-desktop-application&usg=ALkJrhjfL6Dlyi4FJsVl7Q4DNrCyYLs1VwAll Articles