doctrine2 - How to get number of rows in group after GROUP BY select in MySQL? -
let mysql table
example
id | grp | title 1 | 1 | item1 2 | 1 | item2 3 | 2 | item3
after sql select * table group grp
have result:
id | grp | title 1 | 1 | item1 3 | 2 | item3
how can number of rows in group? this:
id | grp | title | grp_count 1 | 1 | item1 | 2 3 | 2 | item3 | 1
and if possible, want doctrine2
if selecting id , title not matter in other words select of id , title while doing group can use following
select id, grp, title, count(*) grp_count table group grp
Comments
Post a Comment