1
I’m trying to sum up the values of several different tables, tried two ways:
Without citing the name of the database:
SELECT SUM(animais_adocao.animal_pendente + animais_encontrados.animal_pendente + animais_perdidos.animal_pendente);
And also citing the name of the database:
SELECT SUM(cademeupet.animais_adocao.animal_pendente + cademeupet.animais_encontrados.animal_pendente + cademeuppet.animais_perdidos.animal_pendente)
In both cases it is returned:
Unknow table in field list, as you can see in the image, the column has this name and the bank too, I’m forgetting something?
sum does not sum the columns, sum the rows, if you want to add columns use only the +
– Lucas Miranda