[AccessD] SQL EXISTS

Heenan, Lambert Lambert.Heenan at aig.com
Thu Oct 23 11:36:09 CDT 2014


What's wrong with a good old fashioned 'unmatched' query?...

SELECT Customers.CustomerID FROM Customers LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID
WHERE (((Orders. CustomerID) Is Null));

Lambert :-)

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
Sent: Thursday, October 23, 2014 12:15 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] SQL EXISTS

Have there been any enhancements to Jet SQL or Access that would improve on using NOT EXISTS subquery to find parent records with no related records in a specific child table?

SELECT Customers.CustomerID, Customers.CompanyName FROM Customers WHERE NOT EXISTS (SELECT * FROM Orders WHERE Orders.CustomerID =
Customers.CustomerID)

Susan H.
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list