mysql - How to get a SUM of grouped COUNT in SQL Query -



mysql - How to get a SUM of grouped COUNT in SQL Query -

i'm trying sum of grouped count.

my table result this.

id | name | count 1 k 5 2 k 4 3 12

i want result lik this.

id | name | count 1 k 9 3 12

these real query.

select count( clubs_messages.id_user ) nbr, users.name, users.id, users.email users bring together clubs_messages on users.id = clubs_messages.id_user grouping clubs_messages.id_user union select 'sum' users.name, count( clubs_messages.id_user ) users bring together clubs_messages on users.id = clubs_messages.id_user

so help please.

i think have grouping name instead of user_id. check next query

select count( clubs_messages.id_user ) nbr, users.name users bring together clubs_messages on users.id = clubs_messages.id_user grouping users.name

mysql sql-server

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -