0
Personal I have a table in my Mysql database like this:
Table name is tb_cargaHora
I’m trying something like this:
SELECT nome, matricula, SUM(carga_hora) FROM tb_cargaHora Order BY nome;
but only the result of Andre
.
id | name | registration | discip | hour |
---|---|---|---|---|
2 | Andre | 191131 | INF03 | 60 |
3 | Andre | 191131 | TEC01 | 60 |
4 | Julia | 203331 | CCI02 | 20 |
5 | Julia | 203331 | TEC01 | 60 |
I would like to add only the workload of students leaving so;
name | license plate | hour |
---|---|---|
Andre | 191131 | 120 |
Julia | 203331 | 80 |
Search for
GROUP BY
– Woss
as @Woss pointed, you need to group, see this question: https://answall.com/a/320494/57220 or here https://answall.com/a/228296/57220
– Ricardo Pontual