dimanche 22 décembre 2019

How to output only 1 if data same

I try it, but didn't output like i want.

Example:

I have table like this :

+----+------+------+
| Id | Name | Total|
+----+------+------+
|  1 | Joni |   2  |
|  2 | Brad |   1  |
|  3 | Joni |   3  |
|  4 | Chuck|   1  |
|  5 | Brad |   3  |
|  6 | Brad |   5  |
+----+------+------+

And i want output like this :

+------+------+
| Name | Total|
+------+------+
| Joni |   5  |
| Brad |   9  |
| Chuck|   1  |
+------+------+
* Count total by Distinct name


Thank you.




Aucun commentaire:

Enregistrer un commentaire