WHERE Clause

WHERE Clause

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release. The Structured Query Language (SQL) WHERE clause is an optional clause of the SELECT Statement that restricts the records to be returned. Conditions are connected using the AND and OR keywords. Parentheses can be used to group conditions into a single logical condition. If the WHERE clause is not included, all the records from the specified URL are returned.

Syntax

WHERE [Expression] AND|OR [Expression]

The parameter condition specifies a single or a set of logical conditions that, when evaluated, result in a TRUE or FALSE result. Conditions are connected using the AND and OR keywords. The following predicates, functions, and clauses can be used in a WHERE clause:

Example

The following is an example of a SELECT Statement that searches the specified folder and returns the displayname Field for only folder resources.

strSQL = "SELECT ""DAV:displayname"" "
strSQL = strSQL & "FROM scope('shallow traversal of ""http://myserver/public/test/""')"
strSQL = strSQL & "WHERE ""DAV:isfolder"" = TRUE"

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

This topic last updated: June 2004

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.