lessql icon indicating copy to clipboard operation
lessql copied to clipboard

SQL group by statement

Open francesco98 opened this issue 8 years ago • 2 comments

Hello, How can I do a select using group by statement?

francesco98 avatar Jun 26 '16 09:06 francesco98

Currently, you can only use PDO directly as LessQL\Result only models these kind of queries:

SELECT
    {* | select_expr, ...}
    FROM table
        [WHERE condition [AND condition [...]]]
        [ORDER BY {col_name | expr | position} [ASC | DESC], ...]
        [LIMIT count [OFFSET offset]]

In the next version (which I'm hoping to release soon), you'll be able to swap $db->post()->where(...) with something like $db( "select * from post where &where group by some_col" )->where(...) without any drawbacks.

morris avatar Jun 26 '16 11:06 morris

Did this every get released? I'm also curious how to achieve this goal with aggregating result sets and performing math operations.

raupie avatar Feb 06 '23 23:02 raupie