OQL Where Clause

Last modified: April 20, 2023

1 Description

The WHERE clause specifies how the data being retrieved must be constrained.

2 Syntax

The syntax is as follows:

1
WHERE <constraint>

<constraint> is an expression for which the value always equals true. Expressions consist of simple comparisons using operators, functions, keywords or system variables.

For more information, see OQL Expressions.

3 Examples

This query retrieves all customers whose name is equal to “Jansen”:

1
2
SELECT FirstName FROM Sales.Customer
WHERE LastName = 'Jansen'

This query retrieves all customers who live in “Rotterdam”:

1
2
3
SELECT FirstName FROM Sales.Customer
INNER JOIN Sales.Customer/Sales.Customer_Address/Sales.Address
WHERE Sales.Address/City = 'Rotterdam'