QBResult
Last updated
Was this helpful?
Last updated
Was this helpful?
The QBResult
class serves as a wrapper for managing query results in the QBSelect
framework. It enables precise control over the structure and content of query results, including the addition of columns, aggregates, functions, case expressions, and subqueries. This flexibility allows developers to define custom outputs that align with specific SQL requirements.
Key features include support for distinct results, dynamic addition or removal of result components, and methods to include primary key columns automatically. Notable methods include add(column, alias)
to add columns with aliases, addSubSelect(query, alias)
for embedding subqueries, and remove(name)
to remove a column by its name.
For further details, refer to the .
Get/set the distinct flag for the query.
Get query builder parent table clause, this may be a query or a join clause.
Get query builder parent.
Add an aggregate to the query result.
Add an aggregate with alias to the query result.
Add a column to the query result.
Add a column with alias to the query result.
Add all columns from a query or a join to the query result.
Add a function result to the query result.
Add a function with alias result to the query result.
Add a case searched expression to the query result.
Add a case searched expression with alias to the query result.
Add the tables' primary pk columns in alphabetical order to the query result.
Add a query to the query result.
Add a query with alias to the query result.
Add a custom subquery to the query result.
Add a custom subquery with alias to the query result.
Add a value to the query result.
Add a value with an alias to the query result.
Clear the columns in the query result.
returns an array with all the columns that will be in the select of this query.
remove a column from the query result.
Remove a column by name from the query result.
Get/set the distinct flag for the query.
Sample
Get query builder parent table clause, this may be a query or a join clause.
Sample
Get query builder parent.
Sample
Add an aggregate to the query result.
Parameters
Sample
Add an aggregate with alias to the query result.
Parameters
Sample
Add a column to the query result.
Parameters
Sample
Add a column with alias to the query result.
Parameters
Sample
Add all columns from a query or a join to the query result.
Parameters
Sample
Add a function result to the query result.
Parameters
Sample
Add a function with alias result to the query result.
Parameters
Sample
Add a case searched expression to the query result.
Parameters
Sample
Add a case searched expression with alias to the query result.
Parameters
Sample
Add the tables' primary pk columns in alphabetical order to the query result.
Sample
Add a query to the query result.
Parameters
Sample
Add a query with alias to the query result.
Parameters
Sample
Add a custom subquery to the query result.
Parameters
Sample
Add a custom subquery with alias to the query result.
Parameters
Sample
Add a value to the query result.
Parameters
Sample
Add a value with an alias to the query result.
Parameters
Sample
Clear the columns in the query result.
Sample
returns an array with all the columns that will be in the select of this query. can return empty array. Then the system will auto append the pk when this query is used.
Sample
remove a column from the query result.
Parameters
Sample
Remove a column by name from the query result.
Parameters
Sample
Type The current state of the distinct flag for the query.
Type
Type
aggregate the aggregate to add to result
Returns: The query result object with the specified aggregate and alias added.
aggregate the aggregate to add to result
alias aggregate alias
Returns: The query result object with the specified function added.
column column to add to result
Returns: The query result object with the specified column added.
column column to add to result
alias column alias
Returns: The query result object with the specified column and alias added.
columns columns to add to result
Returns: The query result object with all columns from the specified query or join added.
func the function to add to the result
Returns: The query result object with the specified function and alias added.
func the function to add to the result
alias function alias
Returns: The query result object with the specified searched case expression added.
qcase The searched case expression.
Returns: The query result object with the specified searched case expression added.
qcase The searched case expression.
alias function alias
Returns: The query result object with the specified searched case expression and alias added.
Returns: The query result object with primary key columns added.
query query to add to result
Returns: The query result object with the specified query added.
query query to add to result
alias result alias
Returns: The query result object with the specified query and alias added.
customQuery query to add to result
args arguments to the query
Returns: The query result object with the specified custom subquery added.
customQuery query to add to result
args arguments to the query
alias result alias
Returns: The query result object with the specified custom subquery and alias added.
value value add to result
Returns: The query result object with the specified value added.
value value add to result
alias value alias
Returns: The query result object with the specified value and alias added.
Returns: The query result object with all columns cleared.
Returns: An array of QBColumn thats in the select of this query.
column column to remove from the result
Returns: The query result object with the specified column removed.
name name or alias of column to remove from the result
Returns: The query result object with the specified column removed by name or alias.