QBSelect
Property Summary
Type | Name | Summary |
---|---|---|
Create an AND-condition to add conditions to.. | ||
Create an case searched expression.. | ||
Get all the columns of the datasource that can be used for this query (select or where clause). | ||
Specifies a comment of the query.. | ||
Get the functions clause from a query, used for functions that are not tied to a column.. | ||
Get the group by clause from a query. | ||
Get the having-part of the query, used to add conditions.. | ||
Get the joins clause of this table based clause.. | ||
Create an OR-condition to add conditions to.. | ||
Get the named parameters from a query.. | ||
Get query builder parent table clause, this may be a query or a join clause.. | ||
Get the result part of the query, used to add result columns or values.. | ||
Get query builder parent.. | ||
Get the sorting part of the query.. | ||
Get the where-part of the query, used to add conditions.. |
Methods Summary
Type | Name | Summary |
---|---|---|
Clear the having-part of the query.. | ||
Get an exists-condition from a subquery. | ||
Get a column from the table.. | ||
Get a column from the table with given alias.. | ||
Returns the datasource for this.. | ||
Get or create a parameter for the query, this used to parameterize queries.. | ||
Returns the internal SQL of the QBSelect.. | ||
Returns the internal SQL of the QBSelect.. | ||
Returns the parameters for the internal SQL of the QBSelect.. | ||
Returns the parameters for the internal SQL of the QBSelect.. | ||
Returns the table alias for this.. | ||
Create an inlined value.. | ||
Create an inlined value converted to the type of the column.. | ||
Create an inlined (quoted) value.. | ||
Create an negated condition.. | ||
Create an negated condition.. |
Properties Details
and
Create an AND-condition to add conditions to.
Returns QBLogicalCondition
Sample
case
Create an case searched expression.
Returns QBCase
Sample
columns
Get all the columns of the datasource that can be used for this query (select or where clause)
Returns QBColumns
Sample
comment
Specifies a comment of the query.
Returns String
Sample
functions
Get the functions clause from a query, used for functions that are not tied to a column.
Returns QBFunctions
Sample
groupBy
Get the group by clause from a query
Returns QBGroupBy
Sample
having
Get the having-part of the query, used to add conditions. The conditions added here are AND-ed.
Returns QBLogicalCondition
Sample
joins
Get the joins clause of this table based clause. Joins added to this clause will be based on this table clauses table.
Returns QBJoins
Sample
or
Create an OR-condition to add conditions to.
Returns QBLogicalCondition
Sample
params
Get the named parameters from a query.
Returns QBParameters
Sample
parent
Get query builder parent table clause, this may be a query or a join clause.
Returns QBTableClause
Sample
result
Get the result part of the query, used to add result columns or values.
Returns QBResult
Sample
root
Get query builder parent.
Returns QBSelect
Sample
sort
Get the sorting part of the query.
Returns QBSorts
Sample
where
Get the where-part of the query, used to add conditions. The conditions added here are AND-ed.
Returns QBLogicalCondition
Sample
Methods Details
clearHaving()
Clear the having-part of the query.
Returns QBSelect
Sample
exists(query)
Get an exists-condition from a subquery
Parameters Object query the sub query
Returns QBCondition
Sample
getColumn(name)
Get a column from the table.
Parameters String name the name of column to get
Returns QBColumn
Sample
getColumn(columnTableAlias, name)
Get a column from the table with given alias. The alias may be of the main table or any level deep joined table.
Parameters String columnTableAlias the alias for the table String name the name of column to get
Returns QBColumn
Sample
getDataSource()
Returns the datasource for this.
Returns String the dataSource
Sample
getParameter(name)
Get or create a parameter for the query, this used to parameterize queries.
Parameters String name the name of the parameter
Returns QBParameter
Sample
getSQL()
Returns the internal SQL of the QBSelect. Table filters are on by default.
Returns String String representing the sql of the Query Builder.
Sample
getSQL(includeFilters)
Returns the internal SQL of the QBSelect. Table filters are on by default.
Parameters Boolean includeFilters include the table filters [default true].
Returns String String representing the sql of the Query Builder.
Sample
getSQLParameters()
Returns the parameters for the internal SQL of the QBSelect. Table filters are on by default.
Returns Array An Array with the sql parameter values.
Sample
getSQLParameters(includeFilters)
Returns the parameters for the internal SQL of the QBSelect. Table filters are on by default.
Parameters Boolean includeFilters include the table filters [default true].
Returns Array An Array with the sql parameter values.
Sample
getTableAlias()
Returns the table alias for this.
Returns String the tableAlias
Sample
inline(number)
Create an inlined value. An inlined value is a value that will appear literally in the resulting sql. For example
results in sql
And
results in sql
with prepared statement value 200.
Inlined values can be used in situations where prepared statement expressions give sql problems, for example in some group-by clauses.
Note that using the same query with different inlined values effectively disables prepared statement caching for the query and may have a negative performance impact.
In case of a string will the value be validated, values that contain a single quote will not be inlined.
Parameters Number number value to inline
Returns Object
Sample
inline(number, columnForType)
Create an inlined value converted to the type of the column.
Parameters Number number value to inline QBColumn columnForType convert value to type of the column
Returns Object
Sample
inline(string)
Create an inlined (quoted) value.
Parameters String string value to inline
Returns Object
Sample
not(cond)
Create an negated condition.
Parameters QBCondition cond the condition to negate
Returns QBCondition
Sample
not(cond)
Create an negated condition.
Parameters QBLogicalCondition cond the logical condition to negate
Returns QBCondition
Sample
Last updated