Hallo!
zur Erklärung:
habe die Tabellen Province und Country. Ich will schaun, ob die Population von Country Austria mit der addierten Summe von Province (Wien, Kärnten, Burgenland etc) übereinstimmt. Aus diesem Grund will ich die 2 Werte subtrahieren. Kommt 0 raus --> stimmen sie überein
das kommt raus:
DAS IST ABER FALSCH
Die Summe von Population ist 7989000 ABER die Population in Country ist 8023244!
Warum werden die 2 Werte nicht subtrahiert?
Was mache ich falsch?!
Danke für eure Hilfe!
zur Erklärung:
habe die Tabellen Province und Country. Ich will schaun, ob die Population von Country Austria mit der addierten Summe von Province (Wien, Kärnten, Burgenland etc) übereinstimmt. Aus diesem Grund will ich die 2 Werte subtrahieren. Kommt 0 raus --> stimmen sie überein
PHP:
select sum(population) from province where country= 'A'
minus
select population from country where code = 'A'
PHP:
SUM(POPULATION)
----------------------
7989000
1 rows selected
Die Summe von Population ist 7989000 ABER die Population in Country ist 8023244!
Warum werden die 2 Werte nicht subtrahiert?
Was mache ich falsch?!
Danke für eure Hilfe!