Was this page helpful?
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

EXISTS (SQL Server Compact Edition)

Updated: 5 December 2005

Specifies a subquery to test for the existence of rows.

EXISTS subquery


A restricted SELECT statement.

Returns TRUE if a subquery contains any rows.

The following example finds all orders in the Orders table, with "Washington" as the Shipping Region, for each employee listed in the Employees table.

SELECT * FROM Orders WHERE [Ship Region] = 'WA' AND EXISTS (SELECT [Employee ID] FROM Employees AS Emp WHERE Emp.[Employee ID] = Orders.[Employee ID])

Release History

5 December 2005

Changed content

Updated code

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft