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

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -