QBColumn

Overview

The QBColumn class represents a column in a QBSelect query. It is used to define conditions, aggregate functions, and transformations within queries. The class provides a range of properties and methods for handling column-specific operations such as mathematical expressions, sorting, and conditional comparisons.

Key properties include abs, ceil, and floor for mathematical transformations, and avg, count, and sum for aggregate functions. Sorting can be applied using asc and desc, while date manipulations are supported with properties like day, month, and year.

Methods enable additional functionality, including comparisons (eq, between, like), mathematical operations (plus, minus, mod), and string manipulations (substring, concat). The parent and root properties provide access to the query's structure, supporting complex query building and integration.

For more information about constructing and executing queries, refer to the QBSelect section of this documentation.

Properties Summarized

Type
Name
Summary

Create abs(column) expression

Create an ascending sort expression

Create an aggregate average expression.

Create bit_length(column) expression

Create ceil(column) expression

Create an aggregate count expression.

Extract day from date

Create an descending sort expression

Create floor(column) expression

Extract hour from date

Compare column with null.

Create length(column) expression

Create lower(column) expression

Create an aggregate max expression.

Create an aggregate min expression.

Extract minute from date

Extract month from date

Create a negated condition.

Get query builder parent table clause, this may be a query or a join clause.

Get query builder parent.

Create round(column) expression

Extract second from date

Create sqrt(column) expression

Create an aggregate sum expression.

Create trim(column) expression

Create upper(column) expression

Extract year from date

Methods Summarized

Type
Name
Summary

Compare column to a range of 2 values or other columns.

Create cast(column, type) expression

Concatename with value

Divide by value

Compare column with a value or another column.

Compare column with a value or another column.

The flags are a bit pattern consisting of 1 or more of the following bits: - JSColumn.

Column type as a string

Compare column with a value or another column.

Compare column with subquery result.

Compare column with values.

Compare column with custom query result.

Compare column with a value or another column.

Compare column with a value or another column.

Compare column with a value or another column.

Create locate(arg) expression

Create locate(arg, start) expression

Compare column with a value or another column.