2
I’m wanting to add up all the clients I have on all my bases, so for that I’m doing the following query:
SET @total = 0;
USE BASE x1; SELECT @total:= @total +COUNT(1) FROM clientes;
USE BASE x2; SELECT @total:= @total +COUNT(1) FROM clientes;
in the current scenario my variable is taking the value of itself and adding to the value of COUNT(1)
;
But every query executed, a result is displayed, I would like it to be displayed only the final result!
A simple
SELECT COUNT(*) FROM clientes
already will not return you your total customers? Or you want to do this with variables even?– Eduardo Silva