PDA

View Full Version : Can Exists only be used in the field Definiton?



prabhafriend
12-13-2010, 08:41 AM
I believe in all the sub-query specific keywords like ANY, IN, SOME, etc EXISTS only can be used in the field defintion. Am I Right?

hansup
12-13-2010, 09:25 AM
Not sure if I understand your question.
Here is a NOT EXISTS example from Allen Browne.
http://allenbrowne.com/subquery-01.html

SELECT Customers.ID, Customers.Company
FROM Customers
WHERE NOT EXISTS
(SELECT Orders.OrderID
FROM Orders
WHERE Orders.CustomerID = Customers.CustomerID
AND Orders.OrderDate > Date() - 90);

prabhafriend
12-14-2010, 01:21 AM
Exists can be also be used in the field definition too. For Example Check1:Exists(....;). But the IN, ANY, SOME cannot be used in the field definition. Am I right?