catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.84k stars 1.15k forks source link

Group by in select query #599

Closed Philippe-M closed 7 years ago

Philippe-M commented 7 years ago

Hello, it's possible in the next release to add a GROUP BY criteria in select query ?

MejorCodigo commented 7 years ago

Medoo already supports Group By, example code from the docs:

$database->select("account", "user_id", [
        // GROUP by single value
    'GROUP' => 'type',

    // GROUP by array of values
    'GROUP' => [
        'type',
        'age',
        'gender'
    ],

    // Must have to use it with GROUP together
    'HAVING' => [
        'user_id[>]' => 500
    ]
]);

https://medoo.in/api/where

Philippe-M commented 7 years ago

oupss, Sorry I had not seen this in the doc.