Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

WHERE Clause (SQL Server Compact)

Specifies a search condition to restrict the rows returned.

[ WHERE < search_condition >]

< search_condition >

Restricts the rows returned in the result set through the use of predicates. There is no limit to the number of predicates, separated by an AND clause, that can be included in a search condition.

The following example uses the WHERE clause to get the total number of units in stock for all discontinued products in the Products table.

SELECT SUM([Units In Stock]) AS [Units Remaining]
FROM Products
WHERE (Discontinued = 'True')

This is the result set:

Units Remaining

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