WHERE Clause
Topic Last Modified: 2006-06-13
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.
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"