Pages::select($select)
Version 2022.2
Select given values
Version 2022.2
Select given values
Array
Get list of new projects
$data = $this->get('pages','project')
->addWhere('status','New')
->select(Array(
'id' => '',
'client' => '',
'amount' => '',
'order_date' => ''
));
Get list of clients that have new projects
$data = $this->get('pages','project')
->addWhere('status','New')
->setGroup('client')
->select(Array(
'client' => '',
'pcs' => 'COUNT',
'average_amount' => 'AVG(amount)',
'total_amount' => 'SUM(amount)',
'first' => 'MIN(order_date)',
'last' => 'MAX(order_date)'
));
Function | Description |
---|---|
LOWER() | To lower case |
UCASE() | |
UPPER() | To upper case |
CONCAT() | Combine multiple values as string |
Function | Description |
---|---|
ROUND() | Round to closest |
FLOOR() | Round down |
CEIL() | Round up |
CEILING() | Closest integer that is bigger than or equal |
Function | Description |
---|---|
SEC_TO_TIME() | |
TIME_TO_SEC() | |
TIME() | |
HOUR() | |
MINUTE() |
Functions | Description |
---|---|
DATE() | |
YEAR() | |
QUARTER() | |
MONTH() | |
WEEK() | |
WEEKDAY() | |
DATE_FORMAT() | |
YEARWEEK() | |
DAY() | |
DAYOFMONTH() | |
DAYOFWEEK() | |
DAYOFYEAR() | |
MONTH() |
Function | Description |
---|---|
COUNT() | Count number of rows |
SUM() | Sum of the values |
MAX() | Max value |
MIN() | Min value |
AVG() | Value average |