Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
Overview
Programmer's Guide > OpenAccess ORM Classic (Old API) > Telerik OpenAccess ORM OQL Reference > OQL - Object Query Language > The Select Statement > Overview

Glossary Item Box

This documentation article is a legacy resource describing the functionality of the deprecated OpenAccess Classic only. The contemporary documentation of Telerik OpenAccess ORM is available here.

As in SQL, the OQL SELECT statement is the basic construct for querying databases. However, while SQL works with tables, rows and columns, OQL works with extents, objects and members. An extent denotes the set of existing objects of a specific class or its subclasses in a database.

A SELECT statement is a query expression that accepts one or more extents (and sometimes sets) as the input set in the FROM clause, producing a new result-set as output. The WHERE clause allows you to specify which objects are selected from the input set. If the WHERE clause is omitted, no filtering is performed. The ORDER BY clause will sort the result-set in the specified sequence.

SELECT Statement—The Basic Components

SELECT [DISTINCT]

Selects objects to be placed in the result-set by specifying class or class-member names. If the key word DISTINCT is provided duplicates are removed.

FROM

Specifies where to search, i.e., the extents or sets to select from.

WHERE

Specifies the filtering conditions as comparisons on member values (optional).

ORDER BY

Specifies the sorting sequence of the result-set based on values of the data-members (optional).

All SELECT statements must include a FROM clause. The WHERE and ORDER BY clauses are optional. Additional clauses and OQL constructs such as COUNT and EXISTS are also supported.

These components of the SELECT statement are described in detail in the following sections. Also presented are example query statements describing specific OQL syntax. You can run these example OQL queries using a sample database.

In this section: