Table of Contents

TSelectCommand Class

Describes a SELECT query, including the fields to retrieve, the source relation, WHERE filters, GROUP BY, HAVING, ORDER BY, and row-range limits.

Syntax

Unit: Aurelius.Sql.Commands

TSelectCommand = class(TObject);

Constructors

Name Description
Create Creates a TSelectCommand with empty field lists and no limits.

Properties

Name Description
FirstRow Gets or sets the zero-based index of the first row to return (used for paged queries).
From Gets or sets the source relation (table, view, or join tree) for the FROM clause.
GroupByFields Gets or sets the list of fields included in the GROUP BY clause.
GroupByStatement Gets or sets a raw SQL fragment used as the GROUP BY clause.
HasFirstRow Indicates whether FirstRow is greater than zero, requiring an offset in the paging SQL.
HasLimits Indicates whether either FirstRow or MaxRows is set, requiring the generator to emit paging SQL.
HasMaxRows Indicates whether MaxRows is set to a value other than -1.
HavingStatement Gets or sets a raw SQL fragment used as the HAVING clause.
LastRow Returns the zero-based index of the last row in the requested page.
MaxRows Gets or sets the maximum number of rows to return; -1 means no limit.
NextAlias Gets and increments the next available table alias, returning a unique string label.
OrderByFields Gets or sets the list of fields and directions for the ORDER BY clause.
OrderByStatement Gets or sets a raw SQL fragment used as the ORDER BY clause.
SelectFields Gets or sets the list of fields to include in the SELECT clause.
SelectStatement Gets or sets a raw SQL fragment to use as the SELECT clause, overriding the field list.
WhereFields Gets or sets the list of structured WHERE conditions.
WhereStatement Gets or sets a raw SQL fragment appended to the WHERE clause.