1
My client JOSÉ appears 4 times in this table, and I wanted to take the total of his balance. How do I do this?
tabela "clientes"
ID NOME SALDO
1 josé 10
1 josé 20
1 josé 30
4 maria 50
5 marta 60
1 josé 100
7 ana 70
8 sara 80
Total de JOSÉ: 160
I wish it were such a simple consultation:
$sql = mysql_query("SELECT user_login FROM clientes ????????? WHERE ID = 1");
Just for the record,
ID = 'josé'
would not bring anything because "jose" is thenome
;id
is an integer :p– rLinhares
Thanks for the remark, I really missed, the correct would be ID = 1
– La Souza
Repeated Ids? If this is autoincrement it’s impossible and your table doesn’t make sense. Tell me what you’re doing with JOIN?
– Guilherme Nascimento
This part of Ids was a typo, please disregard.
– La Souza